Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

InfoWindow closing icon not showing in Google Map

I use this code to create marker and infowindow that shows after clicking on a marker:

// latLng and map are created earlier in code
 var marker = new google.maps.Marker({
        position: latLng,
        map: map
    });

// contentString is just a string with content also created earlier
google.maps.event.addListener(marker, 'click', function(){
        infowindow.setContent(contentString);
        infowindow.open(map, marker);
    });

This code produces everything good except one thing, it doesn't show closing icon in upper right corner of info window.

enter image description here

Anyone knows what could be the problem?

I'm using meteor.js if it makes any difference

This is how I create the InfoWindow:

var infowindow = new google.maps.InfoWindow();
like image 986
Drag0 Avatar asked Aug 22 '13 17:08

Drag0


People also ask

How do I get rid of infowindow in Google Maps?

After constructing an InfoWindow, you must call open to display it on the map. The user can click the close button on the InfoWindow to remove it from the map, or the developer can call close() for the same effect.

What is infowindow in Google Map?

An InfoWindow displays content (usually text or images) in a popup window above the map, at a given location. The info window has a content area and a tapered stem. The tip of the stem is attached to a specified location on the map. Info windows appear as a Dialog to screen readers.


1 Answers

Here is the solution for the problem... It seems google maps have some fun way of dealing with images and there was a problem with css as we thought. So the solution is just to add this to your css file:

img 
{
    max-width: none;
}

That's it, enjoy.

like image 144
Drag0 Avatar answered Sep 27 '22 03:09

Drag0