cityofaustin / atd-data-tech

Austin Transportation Data & Technology Services
17 stars 2 forks source link

How can a user save or share map state? #1704

Open atdservicebot opened 4 years ago

atdservicebot commented 4 years ago

The map is designed to reveal insights about dockless travel patterns—and there's lots to explore. It would be useful to be able to capture current map state (angle, position, zoom, query) in such a way that it can be saved or shared (e.g., via URL).

Migrated from atd-dockless-dataviz #14

atdservicebot commented 4 years ago

From mateoclarke on 2018-11-02:

Doesn't seem too hard to update the URL with mode, flow, and coord params. Map zoom level too I guess. Not as sure about angle. But then we start to have a really long url.

Would we want some kind of UI feature that prompts a user to share the map? Like a button that copies the current URL to the clipboard? Or is that unnecessary. Would expecting a user to copy and send the url from the browser be enough?

atdservicebot commented 4 years ago

From johnclary on 2018-11-02:

It'd be nice to have a "share" button, but just being able to copy/share the URL from the browser would be super.

Definitely straightforward to set PTZ, but will have to figure out how to grab the current PTZ from the map object https://www.mapbox.com/mapbox-gl-js/example/set-perspective/