I'm making a web application for a touch screen that requires a 'rotate screen' functionality. It's easy to rotate everything using CSS transform, and it works on most pages. The problem is when there's a plugin like Mapbox that uses mouse events, the events' position are still relative to the view port. For example, after I rotate 180 degrees, and click top left of the map, which is bottom right of the browser, mapbox would think I clicked bottom right of the map. Same with dragging, it just moved the map the opposite direction.
Is there a better way to rotate a whole page, including all the mouse events? Or is there a way to work around it like automatically replacing mouse event coordinates based on rotation?
Aucun commentaire:
Enregistrer un commentaire