Skip to content Skip to sidebar Skip to footer

Google Map Infowindow Not Opening

I'm using Google Maps in my Rails app and I face some difficulties. I want to show an infowindow when a user clicks on a circle. It works fine when he clicks on a marker but now th

Solution 1:

the 2nd argument of infoWindow.open(); has to be an MVC-Object with a position-property of type google.maps.LatLng

A google.maps.Marker does have a position-property, but a google.maps.Circle doesn't.

Use setOptions to set map and position(e.g. center of the circle) of the infowindow:

infoWindow.setOptions({
  map:      map.serviceObject, 
  position: marker.serviceObject.getCenter()
});

Post a Comment for "Google Map Infowindow Not Opening"