Skip to content

[bug] Map default zoom levels seem to allow for more zoom than supported #188

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

Closed
nemesifier opened this issue Oct 5, 2023 · 4 comments · Fixed by #363
Closed

[bug] Map default zoom levels seem to allow for more zoom than supported #188

nemesifier opened this issue Oct 5, 2023 · 4 comments · Fixed by #363
Labels
bug gsoc-idea Potential step of a GSoC project idea

Comments

@nemesifier
Copy link
Member

We have noticed on different tile providers that they support up to 30m zoom level, but we allow to zoom for more by default, which causes the tile server to provide an empty response and no tiles shows on the map.

We may want to reduce the default max zoom level on the geographic map (maybe we can make this configurable but provide a sensible default).

@d1vyanshu-kumar
Copy link

@nemesifier please review it.

@d1vyanshu-kumar
Copy link

@nemesifier Could you please assist me? I've been attempting to solve this issue, but my current implementation hasn't been effective. Could you provide a robust approach to help me resolve this problem?

@d1vyanshu-kumar
Copy link

d1vyanshu-kumar commented Mar 1, 2024

@nemesifier @pandafy please review this and give some guidance on that if it does not look correct.
import ol from "openlayers";
`const maxZoomLevel = 18;

const osm = new ol.source.OSM();

const getTile = osm.getTileUrlFunction();

osm.setTileUrlFunction((coord) => coord[0] <= maxZoomLevel ? getTile(coord) : 'http://localhost/');

`
this is where I found some ideas to solve this issue:https://jsfiddle.net/jrwtc2df/4/

I tested it the map is continuously loading after a certain zoom level.

d1vyanshu-kumar added a commit to d1vyanshu-kumar/netjsongraph.js that referenced this issue Apr 5, 2024
d1vyanshu-kumar added a commit to d1vyanshu-kumar/netjsongraph.js that referenced this issue Apr 19, 2024
@rishabhknowss
Copy link

Hello @nemesifier
I just reduced the maxZoom value from 32 to 18, and it's working fine. Was it just this, or am I missing something?

Image

dee077 added a commit to dee077/netjsongraph.js that referenced this issue Apr 16, 2025
Prevent map from exceeding supported zoom levels of tile providers and added cursor not allowed on hitting min or max zoom level

Fixes openwisp#188
nemesifier pushed a commit that referenced this issue May 16, 2025
- Enforce sensible default min/max zoom levels  
- Disable zooming buttons when min/max levels are reached
- Added Selenium test for zoom behavior

Co-Authored-By: Deepanshu Sahu <[email protected]>
Co-authored-by: Cestercian <[email protected]>
nemesifier pushed a commit that referenced this issue May 16, 2025
- Enforce sensible default min/max zoom levels
- Disable zooming buttons when min/max levels are reached
- Added Selenium test for zoom behavior

Closes #188

Co-Authored-By: Deepanshu Sahu <[email protected]>
Co-authored-by: Cestercian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment