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

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -