Change Google Maps Infowindow Close Icon - graphics

How can I change the default graphic for the Infowindow close button?

You can do it with CSS, like this:
img[src="http://maps.gstatic.com/intl/en_us/mapfiles/iw_close.gif"]
{ content:url("/img/own_close_button.png"); }
Works on:
Chrome 14.0.835.163
Safari 4.0.5
Opera 10.6
Most mobile devices (default browser)
Does not work on:
FireFox 27.0
IE 11.0

If you're using google maps API V3, then you might want to use the official add on infobox.
Google Maps Utility - Infobox

First you need to hide the default close icon:
.gm-style-iw button.gm-ui-hover-effect img {
display: none !important;
}
Second, force the default button (that holds the image) to have full opacity:
.gm-style-iw button.gm-ui-hover-effect {
opacity: 1 !important;
}
Third, set your own image and position it:
.gm-style-iw button.gm-ui-hover-effect:before {
display: block;
content: "";
background: url('assets/close-red.svg') center center no-repeat;
background-size: cover;
width: 8px;
height: 8px;
right: -19px;
position: relative;
}
Result:

With jQuery you can change the image file location. If I have an image button_close.png that is 16px in size:
jQuery('img[src="http://maps.gstatic.com/intl/en_us/mapfiles/iw_close.gif"]').livequery(function() {
jQuery(this).attr('width', 16).attr('height', 16).css({
width: '16px',
height: '16px'
}).attr('src', 'button_close.png');
});
Of course this only works as long as Google uses this file location.

button.gm-ui-hover-effect {
background: url(your-img.png) !important;
background-size: contain !important;
}
button.gm-ui-hover-effect img {
display: none !important;
}

Using what Dimitrije Djekanovic and Grant suggested, here is a working version for the current API version 3.49 (Mid-May of 2022):
/* hides the x image */
button.gm-ui-hover-effect > span {
display: none !important;
}
/* inserts the customized and clickable image instead */
button.gm-ui-hover-effect {
opacity: 1 !important;
background: url('close.svg') center center !important;
background-repeat: no-repeat !important;
background-size: 16px 16px !important;
/* above is a good size or uncomment the next line */
/* background-size: contain !important; */
}
To test this, go to the StackBlitz demo provided by the official documentation and paste the style.css file while having background changed to:
background: url('https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Mr._Smiley_Face.svg/414px-Mr._Smiley_Face.svg.png')
center center !important;

There isn't really a way to do this. Your best bet would probably be to use a third-party or custom Infowindow.
There's a list of some third-party solutions here.

To replace with (or whatever image you might like), after
infowindow.open(map, marker);
you can try to add these lines
$('img[src="http://maps.gstatic.com/intl/en_us/mapfiles/iw_close.gif"]').each(function() {
$(this).attr('width', 14);
$(this).attr('height', 13);
$(this).css({width: '14px',height: '13px'});
$(this).attr('src','http://www.google.com/intl/en_us/mapfiles/close.gif');
});

Related

SPFx web part's CSS applies to it but not to rest of page?

(SharePoint online, SPFx, modern website)
My end goal is this :
I want to customize some visual aspects of a SharePoint page (title, left nav bar, fonts, etc.)
I want it to happen only on one page
The solution I chose for that was to create a SPFx web part, as opposed to an extension, which I believe would apply to the entire site. I'm simply going to put the web part on that one page and be done with it.
My issue is :
The CSS gets applied properly to the part of the DOM that represents my web part
the CSS does NOT seem to be applied (at all) to anything else from the page.
For example, I don't see this take effect or even appearing at all in the rendered page :
#spLeftNav {
color: red !important;
}
However, this works as expected :
.myWebPartFooBar {
.container {
color:red !important;
}
}
Question : Is there some sort of sanitation mechanism that I'm missing? Does SharePoint intercept that CSS and prevent it from being applied to anything outside of my web part? I don't see any trace of such protection system in online literature but maybe it's common knowledge.
I had similar problem. The problem is that if you are using scss, compiler translates those css tags #spLeftNav into custom webpart only tags to prevent css mismatch on entire site.
To override it put those global css tag in global variable (this will prevent compiler to change it).
My example of "global css":
:global {
#O365_MainLink_Help {
display:none;
visibility:hidden;
}
.InfoPane-section.InfoPaneSection--properties {
display: none;
}
.o365cs-nav-bposLogo .o365cs-nav-brandingText {
display: none;
}
.o365cs-base.o365cs-topnavBGColor-2 {
background-color: #17375e !important;
}
.o365cs-base .o365cs-nav-rightMenus {
background-color: #17375e !important;
}
#spPageChromeAppDiv,
.ms-Nav
{
background-color: #eeece1 !important;
}
.ms-FocusZone .ms-Nav {
top: 0px !important;
}
#O365_NavHeader button#O365_MainLink_NavMenu,
#O365_NavHeader button#O365_MainLink_NavMenu_Responsive,
.o365button .o365cs-nav-brandingText,
.ms-searchux-searchbox {
display: none !important;
}
.CanvasZone:not(.CanvasZone--fullWidth) .ControlZone {
padding: 0px !important;
}
input:not([type]), input[type=email], input[type=file], input[type=password], input[type=text], select, textarea {
background-color: #eeece1 !important;
border-color: #c8c8c8 !important;
color: #17375e !important;
}
.ms-CommandBarItem-link[disabled] i,
.ms-CommandBarItem-link[disabled] span
{
color: unset !important;
}
.ms-compositeHeader-mainLayout {
height: 77px;
}
div[class^='commentsWrapper_'] {
display: none;
}
span.ms-siteHeader-siteName {
white-space: normal !important;
}
.ControlZone {
margin-top: 0px !important;
}
.ControlZone-control,
.ms-SearchBox,
.ms-BasePicker,
.ms-SearchBox-field {
background-color: #eeece1 !important;
}
.commandBarWrapper .ms-CommandBar {
display: none;
}
.ms-compositeHeader {
padding: 0 32px 0px;
}
}

Apply Ngx admin background image

I need to apply background image for ngx-admin
http://akveo.com/ngx-admin/#/pages/dashboard
similar to http://akveo.com/blur-admin/#/tables/basic.
Gopi
try this...
body.nb-theme-cosmic::before {
position: relative !important;
background: url(http://akveo.com/blur-admin/assets/img/blur-bg.jpg) center center no-repeat !important;
background-size: cover !important;
}
Try add this to your #theme/styles/stlyes.scss
.nb-theme-corporate nb-layout-header.fixed ~ .layout-container{
background:url(your-url);
}

SVG cannot resize to parent container

Hi guys i have a problem in IE 11. I have a embed svg which need to interact with its elements... Here is the example just click on floor 5 :
http://infinityproperty.sitetester.biz/floorplans/59
In Chrome and Firefox everything is ok bur in IE it is too little? What could make this thing?
For someone which try everything to resize svg in ie there is a problem with inline svg. When you try to resize it in 100% width it works fine in the major browsers but IE refuse to resize it.
I have managed it to work with one css hack here it is.
Conteiner:
#svg {
display: inline-block;
padding-bottom: 70%;
position: relative;
vertical-align: middle;
width: 100%;
}
#svg svg {
display: block;
left: 0;
position: absolute;
top: 0;
width: 100%;
}
Also remove the width and height of the svg.
With this i got it to work. :)

IE 10+ Transition From display:none Not Working

The problem I'm facing is that when I click on a button to show this element, on IE 10 it doesn't show up. I'm adding the display: block property via JavaScript, that's why it's not in the CSS. It works on all other browsers except IE.
If I remove the transition it shows up.
section {
display: none;
position: relative;
top: 50%;
margin: 0 auto;
width: 400px;
transition: all 0.5s linear;
transform: translate(0,-300%);
}
section.visible {
transform: translate(0,-50%);
}
I solved the issue by showing the section when adding display: block on the visible class rather than using jQuery show(). Guess IE10+ has issues with that.

Changing tab icons in Komodo Edit

I would like to change the default blank tab icons in Komodo, but couldn't find the right CSS selectors.
I created userChrome.css file that works and I could target the language-specific tabs by:
#tabbed-view tabs > tab[label$=".js"]
But the default tab icons always stay on top, no matter which selectors i use. Any suggestions?
Here is how I changed default tab icons in Komodo Edit 7.1:
.tab-icon {
display: none;
}
.tab-image-left {
background-image: url(chrome://famfamfamsilk/skin/icons/page.png) !important;
width: 16px !important;
height: 16px !important;
}
#tabbed-view tabs > tab[label$=".js"] .tab-image-left {
background-image: url(chrome://famfamfamsilk/skin/icons/page_white_code.png) !important;
}
This code should go into userChrome.css

Resources