1

Is it possible to determine a latitude and longitude from an arbitrary Google Maps url that doesn't include a latlng param? For example, the following maps url

https://maps.google.com/maps?q=sutro+baths&hl=en&fb=1&gl=us&hq=sutro+baths&hnear=0x80859a6d00690021:0x4a501367f076adff,San+Francisco,+CA&cid=0,0,16148491297203403134&t=v&z=16&iwloc=A

Secondary, perhaps related question: In that url what do the two colon delimited hex numbers in the hnear param encode?

...&hnear=0x80859a6d00690021:0x4a501367f076adff,San+Francisco,+CA&...

Stephen Handley
  • 2,325
  • 3
  • 19
  • 17

2 Answers2

0

You can specify the url like this:

    http://maps.google.com/maps?z=12&t=m&q=loc:38.9419+-78.3020

I think here is the answer you desire

Community
  • 1
  • 1
0

It looks like there is some work to do, but a related answer here explains where to look in the response of the link(s) for a pattern to get the lat/lon.

The position information is written somewhere in the javascript code inside the html. You can find the pattern "viewport:{center:{lat:xxx,lng:xxx}}" in the javascript code.

How to Obtain Lat/Lng of Google Maps Query String?

Edit: For example, view source of your map page and search for viewport: viewport_center_lat=37.779850006103516;var viewport_center_lng=-122.51384735107422;

Community
  • 1
  • 1
panhandel
  • 674
  • 13
  • 23