I needed to grab several latitude/longitude coordinates recently from Google Maps without using an API. This line can be executed in the console to quickly produce the coordinates derived from the URL.
[_, lat, lng] = location.href.match(/@([-0-9]+\.[0-9]+),([-0-9]+\.[0-9]+),/); console.log(lat, lng);
// 39.9532614 -75.1539449
Top comments (0)