Leaflet/Leaflet

Longtap on markers prompts context menu to save the image

Open

#6,865 opened on Oct 18, 2019

View on GitHub
 (12 comments) (0 reactions) (0 assignees)JavaScript (45,018 stars) (6,124 forks)batch import
bughacktoberfest2023help wantedmobile

Description

This is linked to #6817 fixed by #6855.

How to reproduce: https://jsfiddle.net/f7onauw9/1/

Leaflet Version: Leaflet master as of yesterday (with #6855 in)

Long tap on map: works thanks to #6855, alert appears highlighting a contextmenu/longtap has been detected Long tap on marker: user gets screen to save/share Marker icon, after closing it the alert appears

Expected behavior: when long tap on Marker OS menu to save image should not appear

Relevant code:

var map = L.map('map', { center: [44.22253, 11.77083], zoom: 4, maxZoom: 18, layers: [ L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png')` ], attributionControl: false, tap: true}); map.on('contextmenu', function(e) {alert("MAP: contextmenu/longtap detected"); }); var m = L.marker([44.22253, 11.77083]); m.on('contextmenu', function(e) {alert("MARKER***: contextmenu/longtap detected"); } ); map.addLayer(m);

Contributor guide