I have a public-accessible tiled service hosted on the ESRI ArcGIS Online platform in EPSG 3857 (Web Sphere Mercator).
The service URL is https://tiles.arcgis.com/tiles/RylLPiI61AyfENce/arcgis/rest/services/VISCAmap3857/MapServer
I would like to view the tiled layer as overlay to the OpenStreetMap basemap using Leaflet.
var OpenStreetMap_Mapnik = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{
maxZoom: 19,
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});
map = L.map('map', {
zoom: 7,
center: [-36.5, 145.5],
layers: [OpenStreetMap_Mapnik]
});
I have tried both the Leaflet tileLayer and ESRI's Leaflet tiledMapLayer.
var my_tiled_layer_1 = L.esri.tiledMapLayer({
url: "{MY_ARCGIS_URL}/MapServer"
})
var my_tiled_layer_2 = L.tileLayer('{MY_ARCGIS_URL}/MapServer/tile/{z}/{y}/{x}');
Neither of them worked. I can see the basemap but not the tiled layer. From the browser's development tool window, I can see the {y} {x} numbering was messed up and there were all 404 responses.
Using the post: Leaflet misinterpreting tiles info from an ESRI hosted Tiled Service, I can get the tile layer alone displayed on Leaflet but not correctly overlayed on the OpenStreetMap basemap.