maplibre-rs
maplibre-rs copied to clipboard
Limiting Zoom by style values
To solve the issue, I added a clamp to Zoom and used it in ViewState.update_zoom. I had to add maxzoom/minzoom as parameter/members to ViewState Not yet changed: style-spec-v8.json Todo: Error messages (And it is my first Pull Request ever)
💻 Examples
Set the max/minzoom in the map style to the values, you want to test
🚨 Test instructions
Just zoom in/out to level 0/20. Zooming ends. But the map sliding not! To be investigated
✔️ PR Todo
- [ ] Included links to related issues #161 (not #73)
style-spec-v8.json
That file should be removed soon. It is not used.
(And it is my first Pull Request ever)
Awensome! Please more! :D
@DerKarlos I pushed a fix for the jumping. Basically the issue was that with every zoom there is also a translation of the map (such that the exact coordinates where the mouse points to, stays where the mouse pointer is)
Two editing the same thing may make trouble.
I could merge it but can't build:
maplibre-winit/src/input/zoom_handler.rs:22:56
|
22 | let zoom_changed = actual_next_zoom != current_zoom;
| ^^^^^^^^^^^^ expected (), found struct Zoom
Uh! I can't merge, can't pul, just lost between all the tools.
Bordbuch nachtrag:
Your Zoom.ne needs an epsilon. So this causes the error?: let zoom_changed = actual_next_zoom != current_zoom; update_zoom has no return but used like it does May be I made a mistake while merging. I added the -> Zoom to update_zoom and now it builds runs and zoom limit works without sliding the map. It is merged and should be visible. May be the draft state could be removed
@DerKarlos merged in main to fix builds
@DerKarlos Hi! Are you still interested in pushing this forward? I may be able to help resolving conflicts.