Skip to content

GeometryCollection drag issues #1099

Closed
Closed
@fjfeijoo

Description

@fjfeijoo

maptalks's version and what browser you use?

maptalks v0.47.0

Issue description

When you add a GeometryCollection to the map with {draggable: true} it gives a warning:
"invalid symbol for geometry(Polygon) to draw : {'opacity':0.5}"

followed by an error on "dragend":

maptalks.es.js:29188 Uncaught TypeError: shadow.getCoordinates is not a function
at GeometryDragHandler._updateTargetAndRemoveShadow (maptalks.es.js:29188)
at GeometryDragHandler._endDrag (maptalks.es.js:29160)
at DragHandler._fire (maptalks.es.js:3945)
at DragHandler.fire (maptalks.es.js:3848)
at DragHandler.onMouseUp (maptalks.es.js:4413)
at HTMLDocument.eventHandler (maptalks.es.js:1992)

If you also set {draggable: true, dragShadow: false}, the dragging works but all the geometries in the collection lose the style.

Please provide a reproduction URL (on any jsfiddle like site)

https://codepen.io/fjfeijoo/pen/bGVGeqQ

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions