Skip to content

(Likely) Bug: Adding geometries to FeatureCollection in EditControl #283

@JW-Kraft

Description

@JW-Kraft

Hi there,

I encountered this issue while building a simple app using EditControl based on the example from the documentation.

There, a map is setup with a FeatureGroup containing EditControl and a Marker. The marker is then loaded into EditControl and the user can edit, delete or add new elements in the App while any changes or new elements are mirrored to the second map via the EditControl geojson.
This works fine until any other element than Marker are added as default.

dl.CircleMarker and dl.Circle

  • added to both maps (so EditControl geojson) but breaks editing functions (editing of any elements, also newly drawn ones is not possible anymore).
  • Scaling of the circle marker seems to be different between the two [1]

Any element with multiple coordinates (rectancle, polyline, polygon)

  • Editing functions are not working anymore (deleting elements does work).
  • No more synchronizations between map and mirror - so likely not passed to the EditControl geojson anymore.
  • Causes this JS error:
Uncaught TypeError: Cannot use 'in' operator to search for '_shape' in undefined
    at ce (dash_leaflet.v1_0_15m1745501658.js:2:295235)
    at dash_leaflet.v1_0_15m1745501658.js:2:296659
    at Array.forEach (<anonymous>)
    at dash_leaflet.v1_0_15m1745501658.js:2:296631

I tried to understand the issue in the dash-leaflet core but my minimal JS knowledge makes it challenging.

  • As far as I can see the error happens when binding the mount event for each layer (I assume that is each element added as child of the FeatureGroup) (here)
  • There, _makeFeature is called (here)
  • There seems to be the issue.

Sorry, I cannot identify it any further or provide a feasible solution. Maybe it is easy to fix for someone with experience though?

[1] identical CircleMarke has different radius in the original map and the mirror.
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions