iD icon indicating copy to clipboard operation
iD copied to clipboard

Add a vector layer by TileJSON

Open jleedev opened this issue 2 years ago • 0 comments

Can supply a URL pointing to a TileJSON resource, from which we can extract the xyz mvt URL, minzoom, and maxzoom. Fixes #6021.

Accept any URL that returns the appropriate content-type rather than requiring a URL that ends in ‘.json’, but still fall back to inspecting the extension if the content-type is not an expected one. (This might be from a misconfigured web server, but browsers seem to be flaky when loading a local file.)

FYI, local file uploads are sort of broken on Chrome Android: https://crbug.com/1466960

The settings page seems to forget to show the current URL, possibly as of https://github.com/openstreetmap/iD/commit/16280638b5a6bfaa941a1bee18d57e79dea8e65c

The changeset’s imagery_used continues to be the underlying template URL.

The format argument to setFile is unused except for when the editor is loaded with #gpx=(url). This could perhaps be generalized to accept the URL of any data layer we would like to load, not just gpx. Some data formats really aren't self-describing and need some sort of type identifier, and the URL alone which is stored in the settings might need to be changed to something more structured. (For example, FlatGeobuf, PMTiles, and CSV can perhaps be trusted to always have a file extension in the URL; TopoJSON is often just .json but can be identified by the "type" key … there's some design space to be explored here.)

jleedev avatar Aug 18 '23 17:08 jleedev