"Multiple Location On Google Map"
Bootstrap 3.3.0 Snippet by amolsautade

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <html> <head> <title>Multiple Location On Google Map</title> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> </head> <body> <div id="map" style="height: 400px; width: 100%;"> </div> </body> </html>
var locations = [ ['Pune', 18.563453, 73.802455, 4], ['Banglore', 12.978040, 77.541555, 5], ['Coimbtore', 11.014693, 76.981584, 3], ['Goa', 15.299326, 74.123996, 2], ['Mumbai', 19.075984, 72.877656, 1] ]; var map = new google.maps.Map(document.getElementById('map'), { zoom: 5, center: new google.maps.LatLng(18.558007, 73.807520), mapTypeId: google.maps.MapTypeId.ROADMAP }); var infowindow = new google.maps.InfoWindow(); var marker, i; for (i = 0; i < locations.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map }); google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent(locations[i][0]); infowindow.open(map, marker); } })(marker, i)); }

Related: See More


Questions / Comments: