💄 Map: long press on mobile
This commit is contained in:
parent
d96e33a3c6
commit
5fa9729d6a
@ -193,7 +193,7 @@ export class DashboardComponent implements OnInit, AfterViewInit {
|
|||||||
|
|
||||||
initMap(): void {
|
initMap(): void {
|
||||||
if (!this.settings) return;
|
if (!this.settings) return;
|
||||||
|
const isTouch = "ontouchstart" in window;
|
||||||
const contentMenuItems = [
|
const contentMenuItems = [
|
||||||
{
|
{
|
||||||
text: "Add Point of Interest",
|
text: "Add Point of Interest",
|
||||||
@ -203,7 +203,15 @@ export class DashboardComponent implements OnInit, AfterViewInit {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
this.map = createMap(contentMenuItems, this.settings?.tile_layer);
|
this.map = createMap(
|
||||||
|
isTouch ? [] : contentMenuItems,
|
||||||
|
this.settings?.tile_layer,
|
||||||
|
);
|
||||||
|
if (isTouch) {
|
||||||
|
this.map.on("contextmenu", (e: any) => {
|
||||||
|
this.addPlaceModal(e);
|
||||||
|
});
|
||||||
|
}
|
||||||
this.map.setView(L.latLng(this.settings.map_lat, this.settings.map_lng));
|
this.map.setView(L.latLng(this.settings.map_lat, this.settings.map_lng));
|
||||||
this.map.on("moveend zoomend", () => this.setVisibleMarkers());
|
this.map.on("moveend zoomend", () => this.setVisibleMarkers());
|
||||||
this.markerClusterGroup = createClusterGroup().addTo(this.map);
|
this.markerClusterGroup = createClusterGroup().addTo(this.map);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user