umap-project / umap

uMap lets you create maps with OpenStreetMap layers in a minute and embed them in your site.
https://umap-project.org
Other
1.05k stars 213 forks source link

Emptying data from map settings deletes all layers #1934

Closed Hedaja closed 6 days ago

Hedaja commented 1 week ago

Describe the bug When data gets emptied through the map settings menu, all layers are deleted as well.

To Reproduce Steps to reproduce the behavior:

  1. Go to any map (for example https://umap.openstreetmap.de/en/map/test-layer-selction-hidden-layer_61300)
  2. Click on Edit
  3. Click on Map Advanced Properties
  4. open Advanced Actions and click Empty
  5. All layers are getting completely erased

Expected behavior Keep layers but delete all data (points/lines/areas) within them.

almet commented 1 week ago

Hi, and thanks for taking the time to open an issue. We've just had a look and cannot find the button you're talking about (I don't see an "Empty" button or link).

Do you see the same thing as this screen capture shows? If not, could you please share a capture as well?

image

It can also be because of the translation, or the naming choice on our side, do you think the label is explicit enough? :thinking:

Hedaja commented 6 days ago

Thank you for the quick replay. That's strange. I actually have more options displayed (no matter if German or English interface). grafik Maybe I see more because I am the owner of map. I tried to set full permissions to all other users as well though.

The German umap instance is running umap 2.4.0 by the way.

almet commented 6 days ago

Hey, just found the button you're talking about, and have been able to reproduce locally.

image

(At least the button is here).

Tagging @davidbgk and @yohanboniface if they want to chime in, as we had a redesign of the datalayer explorer lately (it might be related). FWIW, I've checked and it doesn't seem related to the syncing changes.

yohanboniface commented 6 days ago

No, nothing to do with recent changes imho. This seems the expected behaviour (the button calls the Map.empty method), but this behaviour could obviously be challenged. Specifically as we also have a "delete all layers" button.

Let's have two methods, one to empty the datalayers (but keep them), and the other on to delete the layers and data.

Hedaja commented 6 days ago

Let's have two methods, one to empty the datalayers (but keep them), and the other on to delete the layers and data.

Awesome that's exactly what I was hoping that the button would do. I have a map with over 50 filled layers and want to make it a blueprint file, therefore deleting all the data within those layers =)

davidbgk commented 6 days ago

@yohanboniface so we would have both Empty map (removing layers completely) and Empty all layers (erasing inner data but keeping the structure)?

yohanboniface commented 6 days ago

so we would have both Empty map (removing layers completely) and Empty all layers (erasing inner data but keeping the structure)?

Yes! Maybe "Clear data" / "Remove layers" ?