How do I show multiple locations in Google Maps?
问题 I have multiple longtitude and attitude data and I want to show them in the google map with pins. How to use the google map API to do this? 回答1: You iterate over your array, and create a new Marker instance for each pair. It's simple: <script> var map = new google.maps.Map(document.getElementById('map'), { center: new google.maps.LatLng(55.378051, -3.435973), mapTypeId: google.maps.MapTypeId.ROADMAP, zoom: 8 }); var locations = [ new google.maps.LatLng(54.97784, -1.612916), new google.maps