openstreetmap / iD

🆔 The easy-to-use OpenStreetMap editor in JavaScript.
https://www.openstreetmap.org/edit?editor=id
ISC License
3.37k stars 1.21k forks source link

Multiple overlay raster layers #3773

Open bhousel opened 7 years ago

bhousel commented 7 years ago

It should be possible to add custom overlay raster layers via the url api.

bhousel commented 6 years ago

CC @kriscarle for visibility - relates to maphubs/moabi work. Also when vector layers (#3742) become available, that might be a better way forward, but adding multiple raster overlays will still be useful.

kriscarle commented 6 years ago

@bhousel I've got this working here https://github.com/osmearth/iD/commit/764ce07ca1e4cb91bc4c3ef6a9a8f13100c3d8f7 but ended up making the entire app and context loading async, not sure that is ideal, would appreciate your thoughts, thanks!

To clarify, I'm completely overriding the entire config in this example, which I guess is different from adding additional overlays to the list after the UI has rendered once. In my use case I want to remove as well, to simplify the list of options for a given task. For example, instead of telling users "use Bing for this one it has the newest imagery" we pass a config that only offers Bing

RobJN commented 3 years ago

OSM UK now has a layer that we'd like to be able to overlay on top of aerial imagery. I came on here to find an issue related to being able to add custom overlays and found this ticket in addition to #5094. Any updates much appreciated.

kriscarle commented 3 years ago

@RobJN If you want vector overlays, iD now has that built-in, under the Map Data tab. It supports GPX, KML, GeoJSON or you can point it to a vector tile service.

If you want to try the fork we made for https://github.com/osmearth it is still up and running, though it is now about 2 years behind... In OSM Earth you can completely replace the background and overlay options with your own by passing a new JSON config file (hosted somewhere on the internet) in the URL argument imagery_config For example: https://edit.osm.earth/?#background=s2-2018&disable_features=boundaries&imagery_config=https://osmearth.now.sh/projects/42/project-42-imagery.json&map=13.00/-2.9927/141.6683

RobJN commented 3 years ago

I did play with vector overlays @kriscarle and it looks great. The issue is that the data is large and complex. The are 371 data files across England, Wales and Scotland and whilst a user (with some guidelines) could download the data, it does need re-projecting to the right map projection. That task is not easy - we needed lots of support to get it right. Ultimately we decided to take the task on and provide a pre-processed end product for our community. An easy solution they are used to using.

We picked a raster tile layer as everyone is used to these. JOSM also doesn't support vector tiles and unfortunately I don't think we have the resource to run both a raster layer for JOSM and a vector layer for iD.

Furthermore in this case, the vector overlay option in iD is overkill for what we need. This layer is to help mappers properly align aerial imagery. The actual content in the layer doesn't need pulling through in to the OSM database.

So our preference would be for mappers to be able to add our layer as a custom overlay as we feel that is the easiest for the largest number of people.