CodeIgniter Forums
Get marker id in google maps - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Get marker id in google maps (/thread-49509.html)



Get marker id in google maps - El Forum - 02-22-2012

[eluser]bsrbvr[/eluser]
Hi, I want to pass related marker id by clicking marker on google map. I am using marker.getId() function to retrieve marker id. But the marker id is not passing along with url. How can i do this? Any Help?


function AddressMap(lat,lang,markerid)
{
var latLng = new google.maps.LatLng(lat,lang);
var marker = new google.maps.Marker({
'map': map,
position: latLng,
'latitude' :lat,
'longitude' :lang,
icon: image,
shadow: shadow,
id: markerid

});

markers.push(marker);
google.maps.event.addListener(marker, 'click', function() {
[removed] = "www.cickstart.com/" + marker.getId();

});
}


Get marker id in google maps - El Forum - 02-22-2012

[eluser]meigwilym[/eluser]
I thinks it's something to do with using javascript's `this` instead of `marker`, but try a Gmaps forum.

Mei