Skip to content
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

MapServer with custom LODs. initial tile set zoom level is wrong #1384

Open
roocell opened this issue Jan 6, 2024 · 0 comments
Open

MapServer with custom LODs. initial tile set zoom level is wrong #1384

roocell opened this issue Jan 6, 2024 · 0 comments
Assignees

Comments

@roocell
Copy link

roocell commented Jan 6, 2024

Describe the bug

I have a MapServer with custom zoom levels (4 to 9) which corresponds to 13 to 18 on my map.
I set initial map zoom level to 13 and when I add my tile set it is requesting zoom 13 - which makes sense.
But afterwards (somehow) esri-leaflet figures out that zoom 13 corresponds to 4 on my server - I assume this is in some JSON on the MapServer describing this.
So when i zoom/pan after the initial load it grabs the tiles properly.

how do I get the initial tile load to use zoom 4 rather than 13?

right now, I'm just zoom/panning afterwards to get them to load.

Reproduction

var map = L.map('map').setView([45.39793819727917, -75.72070285499208], 100.0);
map.setZoom(13); // start way out (to prevent so many 404s at startup)

L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

L.esri.tiledMapLayer({
    url: "https://maps.ottawa.ca/arcgis/rest/services/Basemap_Imagery_1965/MapServer",
    pane: "overlayPane",
    opacity: 1.0, // make all hidden
    maxNativeZoom: 18, // zoom capability of tiles
    maxZoom: 22, // zoom on map (will stretch tiles)
}).addTo(map);

Logs

initial request
https://maps.ottawa.ca/arcgis/rest/services/Basemap_Imagery_1965/MapServer/tile/13/2935/2370 404 (Not Found)

successful requests after load when zoom/pan
https://maps.ottawa.ca/arcgis/rest/services/Basemap_Imagery_1965/MapServer/tile/4/2937/2371

System Info

https://unpkg.com/esri-leaflet@3.0.12/dist/esri-leaflet.js

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants