Skip to content

Commit

Permalink
Disable double click, pitch and rotate on the mapObject itself
Browse files Browse the repository at this point in the history
  • Loading branch information
hvangeffen authored and wkramer committed Apr 22, 2024
1 parent f928967 commit 5a0d4b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/components/map/MapComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
:scroll-zoom="true"
:transform-request="transformRequest"
:mapStyle="baseLayerStyle"
:doubleClickZoom="false"
:pitchWithRotate="false"
:dragRotate="false"
:touchZoomRotate="false"
:touchPitch="false"
>
<slot></slot>
</mgl-map>
Expand Down
9 changes: 2 additions & 7 deletions src/components/wms/AnimatedRasterLayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,7 @@ function onEndLoading(): void {
}
function addHooksToMapObject() {
map?.once('load', () => {
onLayerChange()
map.dragRotate.disable()
map.touchZoomRotate.disableRotation()
map.doubleClickZoom.disable()
})
map?.on('load', onLayerChange)
map?.on('moveend', onMapMove)
map?.on('sourcedata', onDataChange)
map?.on('dblclick', onDoubleClick)
Expand All @@ -106,6 +100,7 @@ function addHooksToMapObject() {
}
function removeHooksFromMapObject(): void {
map?.off('load', onLayerChange)
map?.off('moveend', onMapMove)
map?.off('sourcedata', onDataChange)
map?.off('dblclick', onDoubleClick)
Expand Down

0 comments on commit 5a0d4b5

Please sign in to comment.