Skip to content

Commit

Permalink
mouseWheelZoom unless used in iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
simon04 committed Feb 8, 2024
1 parent f1a1915 commit 8f2d49e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Control, defaults as defaultControls } from "ol/control";
import { defaults as defaultInteractions } from "ol/interaction";
import { PMTilesVectorSource } from "ol-pmtiles";
import { fromLonLat } from "ol/proj";
import Fill from "ol/style/Fill";
Expand Down Expand Up @@ -97,6 +98,9 @@ function initMap() {
const map = new Map({
target: mapElement,
controls: defaultControls().extend([new DateControl()]),
interactions: defaultInteractions({
mouseWheelZoom: window.self === window.top,
}),
keyboardEventTarget: document,
overlays: [popup],
view: new View({
Expand Down

0 comments on commit 8f2d49e

Please sign in to comment.