Skip to content

BuildWithLal/google-maps-multiple-markers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

###Google Maps multiple Markers

  1. index.html has a div to show Map
  2. map_script.js - javascript to draw multiple markers on Google Map
  3. Link to Google Map API

Automatically center the map fitting all markers on the screen

NOTE

Please put your Google console API key in index.html

<script src="https://maps.googleapis.com/maps/api/js?key=GOOGLE_API_KEY&callback=initiateMap" 
async defer></script>

Get your lat, long list and pass it to var locations in map_script.js

var locations = [
                   [31.5546, 74.3572],
                   [34.0150, 71.5805],
                   [30.1830, 66.9987],
		                
		                		
                    ];

For more details, read this post

Cheers!

About

Draw multiple location markers on Google maps using Google Maps API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published