#10646 closed enhancement (fixed)
[PATCH] Allow data URIs in remotecontrol
Reported by: | sanderd17 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 14.10 |
Component: | Core remotecontrol | Version: | |
Keywords: | Cc: |
Description
It's currenlty possible to create a dynamic OSM file server-side, and serve it to JOSM users by using a remote-control link. But there are some downsides to server-side files:
- Server-side modifications means that porting over websites is harder
- When the files get cleaned on the server (f.e. generated files are no longer considered neccesary), the links become obsolete or wrong
Therefore, for rather small OSM files, the URI data schema would be handy.
Example: http://sanderd17.github.io/8840.html is a webpage I'm making (currently only working in Firefox) that should allow you to download OSM and official CRAB address data in several comparisons. It's meant to be rather portable, so others can host and improve it. Thanks to the data URI, it's possible to generate the OSM data purely dynamical via client-side scripts (which means that no apache, PHP, but just a webbrowser is needed).
Ideally, JOSM would also be able to open it through the remote-control as with server-hosted files.
Attachments (1)
Change History (6)
by , 10 years ago
Attachment: | data_uri.diff added |
---|
follow-up: 2 comment:1 by , 10 years ago
Summary: | Allow data URIs in remotecontrol → [PATCH] Allow data URIs in remotecontrol |
---|
comment:2 by , 10 years ago
Milestone: | → 14.10 |
---|
Replying to sanderd17@…:
This is my first patch, and my first time working with the JOSM code, so please point out any wrong things.
Not bad for a first patch :) I'm refactoring some other code to avoid duplicated methods but this is very nice of you to submit a working patch :)
comment:4 by , 10 years ago
Thanks, it's a very nice cleanup too. I didn't find a good way to avoid that duplication (also because the codebase is still unknown for me, and I don't know what things can be split up easily)
I didn't expect the review to be so quick ;)
I went for a solution without the real data URI, in order to support more specific cases. But the data still has to be encoded directly in the URL. It supports adding data to a new layer or an existing layer. And in the case of a new layer, allows you to suggest a name for it (as the filename, like in the import case, can't be used).
Currently only OSM XML data can be encoded, but I included the option to add mime-types, so different kinds of data could be added (GPX, CSV, ...). With a default to OSM data.
This is my first patch, and my first time working with the JOSM code, so please point out any wrong things.
Click this link to try it (if there are no bugs in either the code or the link).