Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

right-click replacement for mobile? #43

Closed
darkBuddha opened this issue Jun 26, 2018 · 11 comments
Closed

right-click replacement for mobile? #43

darkBuddha opened this issue Jun 26, 2018 · 11 comments
Labels

Comments

@darkBuddha
Copy link

Hi, great tool -- thanks for sharing!

Unfortunately, on multi-touch devices you don't have a way to right-click. Maybe it would make sense to add some kind of substitute?

See https://stackoverflow.com/a/30895557 and https://api.jquerymobile.com/taphold/

@darkBuddha
Copy link
Author

darkBuddha commented Jun 26, 2018

I ended up using this: http://hammerjs.github.io/recognizer-press/

small library (20 kB, 7 kB gzipped), works perfect, easy to integrate.

@darkBuddha
Copy link
Author

disabled tooltips and contextMenu, and used it combination with this: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate

good touch experience, intuitive and haptic feedback

@zhenyanghua
Copy link
Owner

I am not sure if this tool will support Mobile at this time. In addition to the right-click event, the complication include the dragging and hovering special events substitution for mobile devices as well. Do you have a public accessible live demo that uses this library in combination with other touch libraries that solve your use case? I would love to see it in action. Thanks!

@darkBuddha
Copy link
Author

I will upload a demo on the weekend.

@darkBuddha
Copy link
Author

here it is

vibration works only after some user interaction. so move the map a bit, long press, measure, and long press again to get rid of it.

@zhenyanghua
Copy link
Owner

zhenyanghua commented Jul 5, 2018 via email

@darkBuddha
Copy link
Author

I tested it only on Chrome (Android and Desktop) so far, hammer.js say iOS should work: https://hammerjs.github.io/browser-support/

But i just tested it on an iPad and it it's indeed not working. If i get to know why that is i will let you know.

@artipixel
Copy link

You can use the API and create some buttons with a simple logic;

subscribing to measuring events and create a var that saves the status:

measureTool.addListener('measure_start', ()=> {
 this.isMeasuring = true;
});
measureTool.addListener('measure_end', ()=> {
 this.isMeasuring = false;
});

Then you can track the status and display accordingly the buttons
Start - measureTool.start();
end -measureTool.end();

API ref - https://github.com/zhenyanghua/MeasureTool-GoogleMaps-V3/blob/master/docs/REFERENCE.md

@lsantobuono
Copy link

here it is

vibration works only after some user interaction. so move the map a bit, long press, measure, and long press again to get rid of it.

Hey man, any chance you re-upload this?
Thanks a lot!

@zhenyanghua
Copy link
Owner

This library doesn't officially support touch screens.

@zhenyanghua
Copy link
Owner

v1.0.0 now support browser touch events, you will be able to use API start the measure tool with your own implementation of the context menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants