Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the `sll` query parameter for a Maps URL being (sort of) ignored?

According to various references, Google Maps has a query param called sll which does the following:

Latitude,longitude of the point from which the business search should be performed. You could use this to perform an off-centre busness search. Google use it so "link to this page" can record a map that has had the centre moved after performing a business search. When requesting a route map.getBounds().getSouthWest().toUrlValue() returns the same value maps.google.com uses.

So, for instance, if (43.464258, -80.52041) happens to be in Waterloo, Ontario, and (42.24370, -82.98320) happens to be in Windsor, Ontario (many hundreds of kilometers away), then my interpretation of the above documentation would be that the following query:

https://maps.google.ca/maps?saddr=43.464258,-80.52041&daddr=mcdonalds&sll=42.24370,-82.98320

will do a search for "Mcdonalds" from Waterloo, to some McDonald's in Windsor.

Unfortunately, that's not what happens (click for yourself to see!). It ends up doing a search from the saddr point, to the nearest McDonald's to that point. The value of sll doesn't factor into it at all.

But here's where it gets weird! If I omit the sll parameter entirely, then Maps does something completely unexpected: it picks some random McDonald's in Toronto (a city that is many kilometers away from either Waterloo or Windsor). I need to add some sll parameter (for any value) to make Maps return a result in Waterloo (even though what I'm asking for is a result in Windsor).

Am I misinterpreting all the various sources of documentation about this parameter? Is this a bug on Maps' end? And, most importantly, is there any working way to do what I'm trying to do, even if it doesn't involve the sll parameter at all?

like image 688
Adrian Petrescu Avatar asked Jul 26 '12 23:07

Adrian Petrescu


People also ask

How do I get lat long from Google Maps URL?

If the latitude and longitude in the URL is preceded by an "@" symbol, (e.g. https://www.google.ca/maps/@43.6474528,-79.3799409,14.78z):

How do I get Google Maps to open links in the app?

Access Settings in your Android smartphone or tablet. Choose Apps. In the list of apps choose the app used by default to access maps/routes/navigation (Maps for GoogleMaps, or Waze). Choose the Launch by default function.

What is the URL of Google Earth?

Bookmark this question. Show activity on this post. How do I generate a sharable URL for Google Earth Web (https://earth.google.com/web/) when I only have the latitude and longitude?


1 Answers

I can get it to work with a simple query :

from:43.464258,-80.52041 to:mcdonalds near 42.24370,-82.98320

Which gives the expected result. It won't work without near which is a keyword.

You can also search from:43.464258,-80.52041 to:mcdonalds, Windsor if you have the city name.

About the sll (and sspn) parameters, it doesn't work for directions AFAIK. It only works with searches for a single location.

like image 182
Dalmas Avatar answered Sep 28 '22 17:09

Dalmas