URL link to specific object on saved map

Jeremiah Small's Avatar

Jeremiah Small

06 Sep, 2018 10:46 PM

Forgive me if this is documented, but I have spent some time looking through the archives and docs, as well as experimenting with url params, and so far I haven't found the answer(s) I'm looking for. Here's what I'm interested in doing.

I have a local area for which I have defined a couple hundred named object, such as canyons, peaks, trailheads, etc.

I'd like to be able to create a URL that links to each one specifically. So far the only way that I can see to do this in SAR Topo would be to create an individual saved map for each object, and use the saved map URL. This could be fine, but I'm not sure if there are limits to the number of maps we can save, and it would be somewhat awkward to manage over time.

What would be ideal would be a single saved map containing all the objects, into which I could deep link to a specific coordinate, zoom level, base map, etc by adding query parameters to the url.

For example https://sartopo.com/m/T59D#ll=34.21308,-118.12181&z=19&b=oc

  1. Support Staff 1 Posted by caver456 on 09 Sep, 2018 07:01 PM

    caver456's Avatar

    Second that - we would find it very useful too - either a URL-encoded zoom/pan, or an HTTP request handler to zoom to a certain coord and zoom level, or a certain object. Our use case is that we add an object using an HTTP request, and would then like to pan/zoom to it. In that case, we already know the coordinates to zoom to.

  2. 2 Posted by Jeremiah Small on 11 Sep, 2018 09:56 PM

    Jeremiah Small's Avatar

    Yes, exactly. Ideally we could have a single saved map with SAR-relevant objects of interest documented it covering 30 square miles, and be able to hyperlink to specific named things on that map at a pre-set zoom level. Saved map support for url params (Lat Long, Zoom level, and Base map) would completely satisfy our use case. Frankly we could live without definable base map if defaulting to the one defined with the saved map would make this easier.

  3. Support Staff 3 Posted by matt on 13 Sep, 2018 05:27 AM

    matt's Avatar

    I've added url hash support for saved maps, mirroring the map.html page.

    I do want to make clear that I haven't thought this through 100%, so I can't make any long-term guarantees this feature won't get dropped or modified if it winds up causing other complications. I can't think of any at the moment, but time spent developing infrastructure around it is done at your own risk.

  4. matt closed this discussion on 13 Sep, 2018 05:27 AM.

  5. Jeremiah Small re-opened this discussion on 13 Sep, 2018 07:44 AM

  6. 4 Posted by Jeremiah Small on 13 Sep, 2018 07:44 AM

    Jeremiah Small's Avatar

    That is absolutely amazing. I'll start experimenting with it provisionally, and let you know if there's anything that crops up, though I can't currently think of any scenarios where this would introduce any extra performance hits, etc. Particularly since you've set it up to strip the arguments from the url before you render the page. If I can be so bold as to make some assumptions, I suppose this would mean that the map is ending up in the exact same state it would have had the user fetched the saved map, and then manually set the zoom, pan, and base map. This seems like quite a smart choice for the purpose of reducing potential unintended consequences. At first I wasn't sure if I agreed with the choice to reset the url, but the more I think about it, the more it seems like the correct choice.

    It would be nice if the arguments could automatically follow the user selections, because then it would not require any specialized knowledge to create a deep link like this. Any settings made manually would be tracked in the url, and so if a user copies it from the browser, and shares it via text, email, etc., the next person will see the same state they sent.

    In any case, I realized I'm gilding the lily. That's what users are meant to do, right?

    ¯\_(ツ)_/¯

    I'm really still in shock, and pleased as punch to have suggested an idea, and see it implemented in production within a week. Thank you very much.

  7. Support Staff 5 Posted by caver456 on 13 Sep, 2018 12:54 PM

    caver456's Avatar

    Yes Matt, thanks for implementing this so quickly. Any idea when it would
    show up in the offline version?

  8. Support Staff 6 Posted by matt on 13 Sep, 2018 05:46 PM

    matt's Avatar

    Will not make the next one - felt a little too risky - so probably in another month or so.

    However that release will also include a database switch from hsql to sqlite (for multiple reasons), so it might take you a little longer to get it rolled out as it will also affect backup scripts, you'll want to migrate data, etc.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac