- Joined
- May 24, 2015
- Messages
- 241
- Reaction score
- 36
I'm sure most of you brain boxes have already figured this out but I thought I should post it just in case. I like sorting out my route roughly in Google Maps then doing the actual gpx plan in Bascamp so this is a handy dodge to get the co ordinates from google maps to basecamp simply, it just uses java script to grab the long/lat from the url address in Firefox and copies it to the clip board on the Mac, so you can then paste it straight into the search box (top right) in Basecamp.
Might work on PC or other browsers, I've no idea. I used it on Firefox on the Mac. If it crashes your credit rating or gives you an unpleasant little rash somewhere tender, well, use it at your own risk.
I've found it really useful, hope this helps someone.
How to set it up
- In Firefox, make a new bookmark (e.g., put it on the Bookmarks Toolbar).
- Name it something like Copy GMaps Coords.
- For the URL, paste this exact code:
JavaScript:
javascript:(()=>{try{const m=location.href.match(/@(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)/);if(!m){alert('No @lat,lon found in this URL.');return;}const coords=`${m[1]},${m[2]}`;navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(coords).then(()=>alert('Copied: '+coords)).catch(()=>prompt('Copy coords:',coords)):prompt('Copy coords:',coords);}catch(e){alert('Error: '+e);}})();
How to use it
- Open the place/view in Google Maps.
- Click your Copy GMaps Coords bookmark.
- It’ll copy the coordinates to the clipboard (and show a quick confirmation).
If clipboard access is blocked for any reason, it’ll show a prompt with the coords ready to copy.
Might work on PC or other browsers, I've no idea. I used it on Firefox on the Mac. If it crashes your credit rating or gives you an unpleasant little rash somewhere tender, well, use it at your own risk.
I've found it really useful, hope this helps someone.