developmentseed / observe

Cross-platform, offline, field mapping tool for OpenStreetMap
ISC License
67 stars 5 forks source link

Keep polygons closed #302

Closed geohacker closed 4 years ago

geohacker commented 4 years ago

Fixes #301 and also fixes a bug where the node index goes out of order when a node is removed.

sethvincent commented 4 years ago

I tried testing deleting the first/last node and the style didn't update the same way the other nodes do, it just stayed the same. I looked at the ndrefs and coordinates on newWay and those seem to be changed in the expected way, it's just the style that doesn't change.

Things get wacky when I try to delete the first/last node again. Each time I try to delete the node after trying the first time it pushes a new item with the node id of the new first node into the ndrefs. I'm not sure exactly why yet, but if I try to delete first/last node multiple times, theres a whitespace error when submitting the changelog:

Error: Non-whitespace before first tag.
Line: 0
Column: 1
geohacker commented 4 years ago

@sethvincent that was my fault, I was removing first last and additional nodes and also trying to close the way for any delete operation which was unnecessary. My latest commit should fix the behaviour you are seeing.