Mapbox VectorTileLayer 4.15

432
0
05-15-2020 08:15 AM
RemekZajac
New Contributor

Dear All.,

I am trying to get my head around adding of Mapbox base tilesets (i.e.: mapbox-streets-v7) into arcgis.VectorTileLayer.

I have this code:

```

var mapboxStreetsLayer = new VectorTileLayer({
url : "https://api.mapbox.com/v4/mapbox.mapbox-streets-v7.json?f=json&access_token=pk.ey...redacted"
});

```

and see this error in the browser's console:

```

dojo.js:253 [esri.layers.VectorTileLayer] #load() Failed to load layer (title: 'Layer', id: '17218e28949-layer-1') d {name: "request:server", message: "Unable to load https://api.mapbox.com/v4/mapbox.mapbox-streets-v7.json?f=json status: 401", details: {…}}

```

The network tab clearly shows that the access_token has been removed before shooting the request and the url i provided tampered with. I thus cannot load the style. How is it meant to be done?

I am also pondering on this fragment of the documentation. 

"The URL to the vector tile service, or the URL to the style resource of vector tiles that will be used to render the layer. If specifying a URL to a style, the tiles are fetched from the tile servers specified in the style object."

The style scenario is clear, but what is exactly a "vector tile service" (what API is it expected to expose)? And what style will a VectorTileLayer be rendered with if it's initialised against a "vector tile service"?

Tags (2)
0 Replies