Click here to Skip to main content
14,921,361 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have list of link https://maps.app.goo.gl/8M1SZEZHArjoGm8b7 and this https://goo.gl/maps/RuPSqVoP2L66XrYa6

Is there any way to get the latitude and longitude from this link above

What I have tried:

I tried to enter the link but it doesn't give me latitude and longitude in the URL
Posted
Updated 3-May-21 4:00am
v2

1 solution

Have you tried pasting those URLs into your browser, whilst inspecting the network traffic? You'll see that Google responds with an HTTP 302 redirect, with the full google.com/maps URL in the response header. That URL includes latitude and longitude (e.g. https://www.google.com/maps/place/33%C2%B047'46.0%22N+35%C2%B049'07.8%22E/@33.7961111,35.8166446,17z/data=!3m1!4b1!4m5!3m4!1s0x0:0x0!8m2!3d33.796112!4d35.818821 which actually includes the lat/lng in both decimal degrees, and degrees/minutes/seconds (DMS) notation. So you can simply parse the redirect URL. Use an HttpWebRequest and just do a GET on the input URL.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900