javascript - Multiple Markers on Google maps -
this question has answer here:
i using following:
var samplemarker = new google.maps.marker({ position: new google.maps.latlng(51.379, -113.53), map: map, title: "hello world!" }); to add marker map, how use same iterate on array of latlngs? wish add multiple markers.
you can wrap in function , call in loop :
function createmarker(latitude, longitude, mytitle){ new google.maps.marker({ position: new google.maps.latlng(latitude, longitude), map: map, title: mytitle }); } have fun.
Comments
Post a Comment