daybrush / infinite-viewer

Infinite Viewer is Document Viewer Component with infinite scrolling.
https://daybrush.com/infinite-viewer/
MIT License
283 stars 30 forks source link

Map Inside Infinite View (Child Events) #68

Open bmurtagh01 opened 8 months ago

bmurtagh01 commented 8 months ago

I need to deploy a map inside the infinite-view in Svelte. Now my problem is that the events of both the map and the infinite-view are interfering and I can't move the child map without moving the infinite view as well. Is there an option to let know the infinite-view that if I'm dragging the map, then the event belongs to the map, but if I drag outside the map the it moves the infinite view (event of drag and zoom)? My first approach was to avoid the propagation of the events on the map, but then the inifinite-view is on top of its childs.

daybrush commented 8 months ago

@bmurtagh01

I think the structure is like this.

<InfiniteViewer>
    <Map />
</InfiniteViewer>

Like your approach, you could just bind stopPropagation to an event in the map. (mousedown)