Google Maps API Longpress Event?

I am creating a web application for mobile phones, where if they put off a certain part of the map, something happens. Unfortunately, I cannot use window.setTimeout (..) with the mousedown / mouseup combination because the Maps API does not contain these events, as this will violate the drag and drop events. Is there any other way to do this? There must be a way, because Maps Webapp on a mobile phone pops up in the same menu when you right-click on Google maps for computers - you just don’t know how to do it! Please let me know!

Thanks in advance!

+3
source share
2 answers

, DOM mousedown/mouseup, Maps API, . API , (, , ):

 google.maps.event.addDomListener(document.getElementById('map_canvas'), 'mousedown', function () { console.log("Test") });
+1
0

Source: https://habr.com/ru/post/1754722/


All Articles