27

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?

JJJones_3860
  • 1,382
  • 2
  • 15
  • 35

3 Answers3

31

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

raratiru
  • 8,748
  • 4
  • 73
  • 113
  • 16
    But is it possible without directions... just the markers? – Laurens Koppenol Sep 29 '17 at 09:36
  • @LaurensKoppenol Yes, both articles have examples depending on what you want to achieve. The [moz.com article](https://moz.com/blog/new-google-maps-url-parameters) is more relevant if you want to place multiple markers on a map. – raratiru Sep 29 '17 at 15:46
  • 1
    @raratiru Do you know a way to create circular area markers instead of default marker? [Question](https://stackoverflow.com/questions/51059535/google-maps-url-how-to-define-circular-marker) – Tiago_nes Jun 29 '18 at 11:03
  • 1
    This solution only seems to work for max. 3 locations. I'm looking to get directions between 50+ locations. – Charlie Apr 12 '19 at 09:55
  • @Charlie I believe, if you ask Google, they will answer that everything is possible, depending on your pocket size! I mean, it is better to keep a low profile and probably separate those 50+ locations in pairs or triplets. Google limits are very tight in all aspects, this should not make an exception. – raratiru Apr 12 '19 at 11:20
  • 1
    @raratiru they most certainly will! However, we're aiming for free solutions. Our project uses a function to generate routes based on air quality. Once a route is selected, I wanted to pass the route to Google Maps for directions. Do you know of any open-source alternatives? – Charlie Apr 12 '19 at 12:30
  • @Charlie Wow, this sounds like an amazing project and idea! It is better to open a new question in https://gis.stackexchange.com/, it is possible to find there people who have more experience in this field. – raratiru Apr 12 '19 at 13:03
  • 1
    Great, thanks! I believe the approach outlined in the answer will work if the URL is opened on mobile devices with the Google Maps app installed, but I have yet to try this. I'm currently testing on desktop and emulator without Maps. Directions is not necessary for an MVP, so I think we'll come back to this one later. – Charlie Apr 12 '19 at 14:05
15

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
Zoe
  • 27,060
  • 21
  • 118
  • 148
Jay
  • 166
  • 1
  • 2
  • 3
    so why we need google api since routes and markers done using url are fully free. Am i right? – Arie Apr 13 '20 at 00:24
4

I just wanted to add that Yandex.Maps does offer this feature without an api key. The syntax is pretty simple: https://yandex.ru/maps/?ll=[center longitude],[center latitude]&pt=[longitude1],[latitude1]~[longitude2],[latitude2]&z=[zoom level]&l=map

Eg:

https://yandex.ru/maps/?ll=30.310182,59.951059&pt=30.335429,59.944869~30.34127,59.89173&z=12&l=map
RJ Adriaansen
  • 9,131
  • 2
  • 12
  • 26