I want to update a div with information when I touchend the map on my iPad or iPhone. The information div run correctly with a click version but for a touchend I had to use map.on

map.on('touchend', function(e) {*...*}

What I can put on my map.on function to update information in my div using data of my JSON?

I used this for click version :

info.update = function(properties) {

document.getElementById("data1").innerHTML = properties.MUS_NM_MUN;
document.getElementById("data2").innerHTML = properties.MUS_NM_REG;
document.getElementById("data3").innerHTML = percentFormat(properties.POURCENTAG);
document.getElementById("data4").innerHTML = properties.VE_VHR_VBV;};

1 Answer 1


You could use original DOM touch events, but it can get quite complicated. For use on map Leaflet converts all touch events to mouse events.

Processsing of touch events goes like this: if touch lasts less then 1 second, it's interpreted as click, if it lasts more than one second, it fires special contextmenu event.

If you want to catch both, just declare:

map.on('contextmenu click', function(e) {*...*}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.