iD icon indicating copy to clipboard operation
iD copied to clipboard

Add Custom 1, 2, 3 Backgrounds

Open jidanni opened this issue 4 years ago • 6 comments

Description

Here is an idea that only takes one minute of coding: Instead of just:

  • Custom

have:

  • Custom 1
  • Custom 2
  • Custom 3

Screenshots

20220104T005305

jidanni avatar Jan 03 '22 16:01 jidanni

A workaround for this is, to add the different URLs with a hash # in between. This way, they are saved in your session and you can easily switch. Example for three URLs:

https://mapproxy.codefor.de/tiles/1.0.0/strassenbefahrung/mercator/{z}/{x}/{y}.png#https://mapproxy.codefor.de/tiles/1.0.0/zoom/mercator/{z}/{x}/{y}.png#https://mapproxy.codefor.de/tiles/1.0.0/baumbestand_0_1_3_4_merged/mercator/{z}/{x}/{y}.png

tordans avatar Jan 03 '22 18:01 tordans

Here is an idea that only takes one minute of coding:

Please refrain from making work estimates without providing more precise details about the code that would need to change. Handwaving discourages others from coming up with a satisfactory solution that may be more complicated than originally thought.

1ec5 avatar Jan 03 '22 19:01 1ec5

A workaround for this is, to add the different URLs with a hash # in between.

Wow. How did you figure that out?

jidanni avatar Jan 05 '22 08:01 jidanni

From https://github.com/osmlab/editor-layer-index/issues/2335

Instead of having a single Custom layer that can be edited:

image

I would like to be able to add multiple Custom layers. I am constantly switching back and forth between Strava Heatmap and the "Hillshade Multidirectional" version of 3DEP (because the default "Hillshade Gray" 3DEP hides details in shadows when editing climbing cliffs) so I have to paste the URLs each time.

The simplest way to do this would probably just be to add a few more, so it's like "Custom 1" "Custom 2" "Custom 3" instead of just a single Custom slot.

endolith avatar May 26 '24 13:05 endolith

@1ec5 How long would it actually take?

endolith avatar May 26 '24 13:05 endolith

How long would it actually take?

I don’t know, but here’s where we currently define a custom source. It would have to be generalized a bit.

https://github.com/openstreetmap/iD/blob/010a812eaccbdd2a65fa6e099b4ab3cb7cc499e1/modules/renderer/background_source.js#L564-L608

Here’s where the background layer list responds to a change in selection:

https://github.com/openstreetmap/iD/blob/010a812eaccbdd2a65fa6e099b4ab3cb7cc499e1/modules/ui/sections/background_list.js#L246-L272

Here’s where the Custom Background dialog box persists the custom layer in preferences:

https://github.com/openstreetmap/iD/blob/010a812eaccbdd2a65fa6e099b4ab3cb7cc499e1/modules/ui/settings/custom_background.js#L14-L20

There are a few other odds and ends around the codebase, but that should be the meat of it.

1ec5 avatar May 26 '24 14:05 1ec5