Skip to content

Commit 5fa9729

Browse files
committed
💄 Map: long press on mobile
1 parent d96e33a commit 5fa9729

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/src/app/components/dashboard/dashboard.component.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export class DashboardComponent implements OnInit, AfterViewInit {
193193

194194
initMap(): void {
195195
if (!this.settings) return;
196-
196+
const isTouch = "ontouchstart" in window;
197197
const contentMenuItems = [
198198
{
199199
text: "Add Point of Interest",
@@ -203,7 +203,15 @@ export class DashboardComponent implements OnInit, AfterViewInit {
203203
},
204204
},
205205
];
206-
this.map = createMap(contentMenuItems, this.settings?.tile_layer);
206+
this.map = createMap(
207+
isTouch ? [] : contentMenuItems,
208+
this.settings?.tile_layer,
209+
);
210+
if (isTouch) {
211+
this.map.on("contextmenu", (e: any) => {
212+
this.addPlaceModal(e);
213+
});
214+
}
207215
this.map.setView(L.latLng(this.settings.map_lat, this.settings.map_lng));
208216
this.map.on("moveend zoomend", () => this.setVisibleMarkers());
209217
this.markerClusterGroup = createClusterGroup().addTo(this.map);

0 commit comments

Comments
 (0)