Problem/Motivation
When a saved map is edited the GeoJSON data string is extended with new data, instead of replaced.
Steps to reproduce
- Create a field with the leaflet widget
- Add some data by drawing multiple polygons
- Check the GeoJSON field (1 feature for each polygon)
- Save the node
- Edit the saved node
- Check the GeoJSON field (1 multiploygon, this conversion is done by geoPHP)
- Delete the new combined multipolygon in the leaflet map
- Check the GeoJSON field (1 feature with 1 multiploygon)
Proposed resolution
Clear the correct list of layers.
Remaining tasks
Create a patch
Review the patch
Apply the patch
User interface changes
None
API changes
None
Data model changes
None
Issue fork leaflet-3183154
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
tessa bakkerThe MR will always force a recalculation of the string for the GeoJSON-field.
Credits to SpadXIII for finding the problem of this issue.
Comment #4
tessa bakkerComment #8
itamair commentedThanks so much @Tessa. I couldn't reproduce your issue. I think that last version of Leaflet was already working properly on this.
But your code updates looks better than the existing one. Hence I am merging and committing into dev.
Will be part of the next Leaflet 2.1.x release ...
Comment #10
itamair commented