Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps - Multiple Markers via URL only

Tags:

If I want to open a browser to Google Maps to center and show a single marker, I do it with a URL like this:

https://www.google.com/maps/place//@33.91729,-106.85761,10z/data=!4m2!3m1!1s0x0:0x0

But, I have 5-10 lat/long pairs that I want to show on that same map. How can I show multiple lat/long markers all specified only in a URL?

like image 838
JJJones_3860 Avatar asked Feb 15 '16 02:02

JJJones_3860


People also ask

Can I load multiple addresses on Google Maps?

Once you find what you're looking for, tap on the Directions button. Now, tap on the three dots on the top right and select 'Add stop'. Enter the details and the stop will be automatically added in your list. You can add up to nine stops at a time.

How many markers can Google Maps API handle?

2048 characters in URL is just under 100 GeoCode values. So, again no more than 100 markers.


2 Answers

There is an up-to-date article (updated: May 18 2017) about easily linking to locations and directions using the New Google Maps.

You could use the directions service and form a url as such:

https://www.google.com/maps/dir/33.93729,-106.85761/33.91629,-106.866761/33.98729,-106.85861 

Use double slash "//" between markers to leave a position empty e.g. to set a custom start point.

Update

There is another excellent article here

like image 131
raratiru Avatar answered Sep 24 '22 12:09

raratiru


Well, it is possible without directions. just add at the end: //@ . example:

https://www.google.com/maps/dir/33.93729,-106.85761/33.91629,-106.866761/33.98729,-106.85861//@34.0593359,-106.7131944,11z 
like image 26
Jay Avatar answered Sep 22 '22 12:09

Jay