Select to view content in your preferred language

WebTileLayer: Can't fetch tiles from external URL

303
1
02-06-2024 08:57 AM
aande
by
New Contributor

Hi there!

I'm trying to add a WebTileLayer to my map, however the resulting URL when fetching tiles isn't correct.

My code:

const webTileLayerFromUrl = new WebTileLayer({
});
 
esriMap.basemap = new Basemap({
    baseLayers: [webTileLayerFromUrl],
});

 

Example of correct URL for these map tiles (works): https://maps2.wien.gv.at/basemap/geolandbasemap/normal/google3857/19/181789/285965.png

A URL generated by my code when run (does not work): https://maps2.wien.gv.at/basemap/geolandbasemap/normal/google3857/19/288513/154195.png 

 

I'm assuming I've done something wrong when creating my WebTileLayer, but I'm not quite sure how to fix this.

 

Things I've tried so far:

- Swapping the {x} and {y} in the urlTemplate (wasn't the issue)

- The geolandbasemap uses a tile size of 256. I tried adding a tileInfo with size = [256, 256]. That did not help either.

- Swapped the urlTemplate for another, to make sure there was no issue with my code itself: E.g. https://a.tile.openstreetmap.org/{z}/{x}/{y}.png loads just fine.

 

If anyone has any advice, I would greatly appreciate it 🙂

 

Tags (1)
0 Kudos
1 Reply
aande
by
New Contributor

Update: Ended up finding an Esri Vector Tile Service for the same basemap, which I'll use instead of the WebTileLayer. Unfortunately I'm not sure what the solution would have been if I continued to investigate.

 

0 Kudos