Open nielsbom opened 2 months ago
Lucas:
Ah I would prefer to force the north/south axis, rather than adding in the orientation icon
To block the orientation axis to north/south I'm thinking adding these lines to src/lib/map.svelte on line 97:
map.dragRotate.disable(); // Disables rotation via dragging.
map.touchZoomRotate.disableRotation(); // Disables rotation via touch gestures.
map.keyboard.disable(); // Optional: Disables keyboard interactions. (**it was set to .enable before**)
I tried to test it on my phone via localhost but the map isn't showing up
That looks right. I would have expected MapLibre to have a one-liner for this but I don't think they do.
The other option would be to force the bearing set to 0 (e.g. map.on('rotate', () => map.setBearing(0));
but that could cause a glitchy response, not sure.
I liked including the keyboard option for navigating the map and I think it's useful for accessibility. Could you look into if there's a way to keep that keyboard functionality but not allow rotation? Or test out the option above.
On the map not showing up, the tiles will have CORS issues if you access it through your phone. Maybe we use a different approach for which sites are allowed (similar question to #42). All-in-all, current approach is causing a hassle with the development workflow.
(from Slack)