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.
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();
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With