Skip to content

Commit a4b5439

Browse files
committed
fix types
1 parent 25a4ba1 commit a4b5439

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

app/src/MapView.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import * as maplibregl from "maplibre-gl";
2020
import type {
2121
LngLatBoundsLike,
2222
MapGeoJSONFeature,
23+
MapMouseEvent,
2324
MapTouchEvent,
2425
StyleSpecification,
2526
} from "maplibre-gl";
@@ -376,7 +377,7 @@ function MapLibreView(props: {
376377
});
377378
});
378379

379-
const showContextMenu = (e: MapTouchEvent) => {
380+
const showContextMenu = (e: MapMouseEvent | MapTouchEvent) => {
380381
const features = map.queryRenderedFeatures(e.point);
381382
if (hiddenRef && features.length) {
382383
hiddenRef.innerHTML = "";
@@ -389,7 +390,7 @@ function MapLibreView(props: {
389390
}
390391
};
391392

392-
map.on("contextmenu", (e: MapTouchEvent) => {
393+
map.on("contextmenu", (e: MapMouseEvent) => {
393394
showContextMenu(e);
394395
});
395396

@@ -410,12 +411,9 @@ function MapLibreView(props: {
410411
map.on("touchend", clearLongPress);
411412
map.on("touchcancel", clearLongPress);
412413
map.on("touchmove", clearLongPress);
413-
map.on("pointerdrag", clearLongPress);
414-
map.on("pointermove", clearLongPress);
414+
map.on("mousemove", clearLongPress);
415+
map.on("drag", clearLongPress);
415416
map.on("moveend", clearLongPress);
416-
map.on("gesturestart", clearLongPress);
417-
map.on("gesturechange", clearLongPress);
418-
map.on("gestureend", clearLongPress);
419417

420418
mapRef = map;
421419

0 commit comments

Comments
 (0)