Closed opetznick closed 12 years ago
Markers are stored in Gmaps.map.markers
, so one marker is var myMarker = Gmaps.map.markers[i];
If you want the google or whatever provider marker object: myMarker.serviceObject
.
You end up with:
<a href="javascript:void(0);" onclick="Gmaps.map.serviceObject.panTo(Gmaps.map.markers[i].serviceObject)">Show me my marker</a>
But you have to tell what is i
.
Sidenote, in the next version of gmaps4rails, the api will change a bit. Beware when you update.
@apneadiving Thanks for the Sidenote... I updated to V2 and now my markers don't open. how can I access them to open? I searched a lot, but found no solution...
hello
i was wondering if its possible to trigger the open infowindow event on the marker using a js function?
something like:
is there a way to get the mymarker object with gmaps4rails?
thanks in advance oliver