MAD icon indicating copy to clipboard operation
MAD copied to clipboard

#959 can't edit multi geofence areas.

Open Boby360 opened this issue 3 years ago • 4 comments

Name says it all, multi geofence areas can't be edited by the new geofence editor.

Boby360 avatar Aug 30 '20 02:08 Boby360

Could you be a bit more precise? What doesn't work?

sn0opy avatar Aug 30 '20 07:08 sn0opy

Exactly @TobiasHeinrichIWU As you cant see them in the geofence area, you cant edit them. There is also no link between an area being active and editable.

Any ideas why it seems like this is by design @sn0opy ?

Boby360 avatar Aug 30 '20 19:08 Boby360

Author of #959 here. First note that you should still be able to go to the Areas tabs in the sidebar to view what you had before the PR (it's just the old fences tab but renamed).

That aside, that was by design as I focused on being able to edit one polygon per fence. As a recent user of MAD, at first I had no idea you could have multiple polygons for a single fence. I understood that later by reading the code and decided to focus on the simple scenario (avoid scope creep to get things done ;)).

Multiple polygons editing should of course be possible, but is harder:

  • Making a single polygon comprised of multiple polygons representing the outer shape + holes should be forbidden since I believe MAD doesn't support this directly (holes are made using an excluding geofence instead.)
  • I don't know how leaflet-geoman reacts when editing a multi-polygon with intersections (you want multiple polygons to be able to intersect with each other, but not a polygon with itself; yet at the end of the day it's still a single geometry object).
  • Adding new polygons to a geofence (and removing existing ones) should be possible.

A first easy step could be to show those fences on the map for completeness, but disallow editing. Then a proper multi-polygon editing solution could be implemented.

MrJul avatar Aug 30 '20 21:08 MrJul

Hello MrJul,

the solution is easy... Behave like displaying 2 single geofences, which are both editable each alone

A Multifernce is just a compilation of Single Fences [fence1] x,y [fence2] x,y [fence3] x,y

so it can be displayed and edited like 3 single fences

the "only" hard part is, finding the fence section withing the multifence data, and just replacing this, but i m sure, its easy for someone with coding knowledge

I have a multifence combined from 3 single when i display all 3 single..i can edit each on one map, just one fence after the other they just get saved in 3 seperated "files", while the same in multifence is saved in one, but seperated by [fencename]

ChaosEmpire avatar Feb 02 '21 10:02 ChaosEmpire