-
Notifications
You must be signed in to change notification settings - Fork 761
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
Enable zoom on live view of the car. #2184
Conversation
@adriankumpf This is a great feature to add. Can you accept this PR? |
Would it be possible to show the zoom buttons only when hovering (or tapping on mobile devices)? This would allow to preserve the clean appearance while offering advanced features, such as the map zoom. |
I'm not sure how to accomplish that. Instead I've changed the options to allow for dragging the map, zooming with scrolling, and zooming with pinch on mobile. Thoughts? |
I like that better. The catch is that it becomes harder to scroll on mobile or small touch devices. It may also surprise you if you are scrolling with the mouse wheel and have just accidentally positioned the cursor over the map. I can imagine that displaying the controls while hovering might be a good middle ground. For example, you could do it like this: const map = createMap({
// ...
zoomControl: true,
// ...
});
map.removeControl(map.zoomControl);
map.on('mouseover', function(e) { map.addControl( map.zoomControl ); });
map.on('mouseout', function(e) { map.removeControl( map.zoomControl ); }); |
Agreed, it's pretty nice this way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Thank you.
No description provided.