I am trying to add an arcgis online served vector tiles service to a Leaflet map. I am using ( https://github.com/Leaflet/Leaflet.VectorGrid ) to add the vector tiles to a Leaflet v1.3.1 map application.
I am able to add ESRI layers into the Leaflet map using the following simplified code:
var esriTilesUrl = "https://basemaps.arcgis.com/v1/arcgis/rest/services/World_Basemap/VectorTileServer/tile/{z}/{y}/{x}.pbf";
var esriTilesPbfLayer = L.vectorGrid.protobuf(esriTilesUrl);
esriTilesPbfLayer.addTo(map);
However, when I try to add my arcgis online vector tiles to the leaflet map using the same code
var esriTilesUrl = "https://tiles.arcgis.com/tiles/l4TwMwwoiuEVRPw9/arcgis/rest/services/CaryHouseHolds/VectorTileServer/tile/{z}/{y}/{x}.pbf";
var esriTilesPbfLayer = L.vectorGrid.protobuf(esriTilesUrl);
esriTilesPbfLayer.addTo(map);
I get the following error:
What is the correct url to use to consume arcgis online vector tiles?
Best Answer
I would suggest referencing Esri Leaflet in general for leaflet and Esri related code.
In regards to the Esri Vector Tile Layer You can use this option and construct.