Mobile device URL scheme
Is there a mobile device (eg ios and android) url scheme to open the CalTopo mobile app to a specific location?
Something like Gaia’s gaiagps://map?lat=12.3456&lng=123.45&z=8
I’ve tried a number of permutations/guesses that do not work:
caltopo://map?lat=12.3456&lng=123.45&z=8 caltopo://map?lat=42.0000&lon=-71.0000
caltopo://map?ll=49.12975,-123.97037&z=8 caltopo://map/40.7128,-074.0060
Is there a URL scheme that does work? Thanks.
Comments
3 comments
Hey there!
You're close, the format that will open to a specific location in the mobile app is the same as it is on the web.
On web if you open an unsaved/blank map (i.e. go to https://caltopo.com/map.html), click 'settings' in the top right and make sure that 'Update URL on Map Move' is selected, then the URL in the address bar of your browser will update to reflect the current center location, zoom level, and base layers. As you move the map the URL will change to reflect what you're currently seeing.
If you copy and paste this URL and send it to a mobile device, when you click the link on the mobile device it will open the app to an unsaved map with the location, zoom, and layers that were specified in the URL. Assuming that the app is installed on said mobile device, of course.
Let me know if any of that is unclear.
Hope this helps,
Zach
Zach, thanks for the response. Is there a generic URL scheme (pattern) an app dev could use to launch the CalTopo app to a specific set of coordinates from another phone app when there is no internet or cell service?
There’s no ability to use the CalTopo website. The use case doesn’t involve manually copying and pasting URLs. Just a phone with CalTopo previously installed and offline maps downloaded.
The goal here is to lightly integrate CalTopo and “Offline Spotter”, an app used by amateur radio operators who climb mountains and operate their ham radio from the summit. There is an international program (gamified activity, organization, volunteers) called SOTA with a defined and limited list of summits and coordinates. The Offline Spotter app will have a database of all the summits and coordinates. Kris, the Offline Spotter dev, asked his community for what GPS hiking apps his user prefer so Kris can integrate them to his app. I nominated CalTopo and I’m trying to help Kris out.
Just looking for the generic URL scheme please, thanks.
Tony.
Yes, there is a generic URL scheme. If you open a link to e.g. `https://caltopo.com/map.html#ll=37.80731,-107.67682&z=14&b=imagery` on a mobile device with CalTopo installed it will launch CalTopo and open the map to the coordinates in the URL, at the zoom in the URL, with the layers in the URL.
There's no need to use the web application to generate that URL, or to copy and paste that URL. You could generate and navigate to that URL programmatically within your integration. I was describing getting that URL from the website because I thought it would help you see how the URL scheme works. I thought showing a single example here and explaining it would be more confusing and challenging than showing you where you can get an infinite number of examples.
Hope that helps,
Zach
Please sign in to leave a comment.