android - Google Maps (JavaScript API) and Tablet Touch Events -


i use following code (i quote parts of it) post markers on google map right click point.

google.maps.event.addlistener(map, 'rightclick', function(event) { // code open bubble new marker             });  

i need open bubble, when long press tap on tablet. need make application usable tablet/mobile users.

i read jquery plugins handle touch events, don't know how use them. need simple solution based on code above (to run "//code" open bubble.

well, can use tabhold function on jquery, click event in google maps js api v2.

the taphold function in jquery, can tab , hold action on tablet. not return lat lng us.

for lat lng, can grab google maps onclick function.

so can combine 2 following:
1. let tabhold set flag, indicate click function tabhold
2. on onclick function, check if current click event tabhold, if so, perform action.

i have quick demo on jsfiddle, copied , pasted code looks kind of ugly. helps.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -