derive icon indicating copy to clipboard operation
derive copied to clipboard

Feature request: Shareable maps

Open jbuckner opened this issue 6 years ago • 4 comments

I think it'd be great to be able to send someone a URL with a reference to a JSON object that lets them see your map.

jbuckner avatar Apr 13 '18 20:04 jbuckner

While this would be awesome, it would not be possible by URL without paying for hosting. At the moment everything happens on the client side, so the tracks are stored in the browser but not transferred anywhere. Given the size of these tracks, they could not be URL-encoded, as they are about a megabyte in size individually, so they would be massive with multiple tracks. Instead, what might work is an option to export to a TCX with multiple tracks, as well as initialisation data for dérive, so you could share the file and the link to upload it.

What might work even better would be a shareable HTML file containing all the tracks, and an iframe that it passes the data to, but this is very dependent on browser security policies allowing a locally stored HTML file to include a secure page, and to pass a message to it.

c-harding avatar Apr 13 '18 20:04 c-harding

Yeah I figured this would be tricky data-wise while still being (mostly) client-side, I just wanted to start the conversation to see if some creative solutions like yours came up 😄

I'm going to put some more thought in to it.

jbuckner avatar Apr 13 '18 20:04 jbuckner

What about building an option to export the derive configuration and tracks as a JSON file. The user could upload that file to a server configured with the proper CORS configuration (this would be up to them). They then share a link like this: https://erik.github.io/derive/?mapdata=http://my.server.com/data.json and derive loads the data file.

jbuckner avatar Apr 14 '18 04:04 jbuckner

So I did a quick implementation of this (https://github.com/erik/derive/tree/erik/geojson), and exporting about 2 years of data as GeoJSON for me comes out to roughly 45MB, which is large enough to be inconvenient to share. We could definitely save a bunch of space by going with a binary encoding instead, but that might be harder to host on public pastebin type sites, and wouldn't be compatible with existing programs.

Hrm.

Maybe it's worth having the GeoJSON output anyway?


Could also try something like geobuf, which would save us from reinventing the wheel.

erik avatar Apr 21 '18 21:04 erik