Replies: 1 comment 2 replies
-
I was doing some testing on if deck.gl can do this outside of a normal
Mapbox/MapLibre setup the Being able to update the deck controller when using MapOverlay would be perfect 🙏 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Im trying to implement some basic 'drag' functionality that allows a user to drag a geoJSON feature around the map.
I've realised that I need to prevent the default panDrag behaviour while the feature is being dragged, however I'm hitting a number of problems and not sure how to proceed.
I'm using a vanilla JS implementation with MapLibre and the MapboxOverlay (non interweaved)
Things tried:
event.stopPropagation()
andevent.stopImmediatePropagation()
on the src geoJSON layer to prevent the drag events from bubbling but theevent
doesnt have those methodsmap.dragPan.disable()
, this does disable dragPan, however it causes theonDragEnd
event to fire and theonDrag
event not to trigger any moreonViewStateChange
to get access to theDeck
controller and setdragPan
there, but this callback doesnt fire?Problems:
onViewStateChange
doesnt fire with MapboxOverlaypreventDefault()
/stopPropagation()
cant be triggered?Ideal Outcome
I think Ideally it would be great to be able to access the Deck Controller that is created when we use the
MapboxOverlay
, so that I can hook into the existing events and manage things directly there, but I dont think this is possible because it uses theMap
controller?If thats not possible, how can I prevent the default panDrag behaviour while preserving the
onDrag*
(and other) handlers?The below CodeSandbox illustrates the problem, if you uncomment the
onHover
callback you can see that the geoJSON feature does moves with the mouse - I want this to happen during theonDrag*
handlers.https://codesandbox.io/p/devbox/bitter-grass-kvctsc
Beta Was this translation helpful? Give feedback.
All reactions