Map legend for hiking and cycling routes (via bookmarklet) #377
59de44955ebd
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm a big fan of OpenTopoMap and also of the hiking and cycling route overlays based on data provided by Lonvia. But when planning a trip, only having the route symbols in the map without knowing the corresponding official route names (like e.g. "66-Seen-Wanderweg") doesn't help much.
waymarkedtrails.org also provides a public and documented API for getting the names of the routes that are currently displayed in the map (as determined by its bounds). So I wrote a simple script that adds a map legend as overlay div to OpenTopoMap. The legend is only visible when either the hiking or cycling overlay (or both) is currently visible, and updates its contents automatically whenever the map bounds change. Attached a sample screenshot.
The script can be loaded into OpenTopoMap via a bookmarklet, just create a new bookmark in your desktop browser, name it e.g. "OpenTopoRoutes" and set its URL to this:
javascript:(function(){const%20scr=document.createElement('script');scr.src='https://59de44955ebd.github.io/opentopo-routes/routes.js';document.body.appendChild(scr)})();
Click on this new bookmark (only once) after loading opentopomap.org, et voilà, now there is such a legend when you activate a Lonvia route overlay.
I'm fine with this little hack, but of course this stuff could also be added directly to the OpenTopoMap page if that seems useful.
Best regards
Beta Was this translation helpful? Give feedback.
All reactions