Make it possible to click on either map to choose a pool

This commit is contained in:
Eli Ribble 2026-04-16 04:47:41 +00:00
parent 259960cf45
commit e1f3c93a1d
No known key found for this signature in database
6 changed files with 34 additions and 22 deletions

View file

@ -140,12 +140,12 @@ import {
import LayersControl from "@/components/LayersControl";
import { boundsMarkers, boundsDefault } from "@/map-utils";
import { MapClickEvent, Marker, Point } from "@/types";
import { type MapClickEvent, type Marker, Point } from "@/types";
import type { Location } from "@/type/api";
import type { Camera, MoveEndEventInternal } from "@/type/map";
interface Emits {
(e: "map-click", event: MapClickEvent): void;
(e: "click", event: MapClickEvent): void;
(e: "update:modelValue", value: Camera): void;
}
interface Props {
@ -288,8 +288,9 @@ const initializeMap = () => {
type: "raster",
});
_map.on("click", (e) => {
emit("map-click", {
_map.on("click", (e: maplibregl.MapLayerMouseEvent) => {
e.preventDefault();
emit("click", {
location: {
latitude: e.lngLat.lat,
longitude: e.lngLat.lng,