Pan to marker with Javascript

Feb 8, 2012 at 6:10 PM

I had this working in a prior version of your control, but it doesn't seem to work the same in this version. I'm using the map control to show stores. Along side the map is a list of the stores with their information. As the site visitor mouses over the store info (which is in a DIV tag), I want to pan to the store on the map.

So, I need to be able to reference the map markers via Javascript.

How can I accomplish this in version 6?

The old, working script was:

    function doMyPanTo(i) { //lat, lng
    var map = ctl00_content_WhereToBuy_GoogleMap_Map;
    if (map.Markers[i].GMarker != null) {
        var center = map.panTo(map.Markers[i].GMarker.getLatLng());


Thank you,


Feb 17, 2012 at 5:48 PM


I managed to get this working.

Try this:[0].markers[i]);


mapAppt is the ID of the map and _behaviors[0] is the reference to the Artem:GoogleMarkers extender.

Please post any improvements.


Feb 17, 2012 at 8:10 PM

Thank, fleisch. I'm still having problems. I'm getting a Javascript error that "maps" is not defined. Any thoughts?

Feb 17, 2012 at 8:25 PM


"maps" is the Artem namespace.  It really must be there, so I'd say that your javascript should be much lower in the code (not in <HEAD> element) after the namespace has been initialized.  Search for "maps namespace".

Feb 17, 2012 at 8:39 PM

Yeah, my script is already at the very bottom of the page.No luck. Are you using the latest version of the control?

Feb 17, 2012 at 9:33 PM

Yes, v6.  I meant search this forum/discussions for "maps namespace".