In 3.15, you can use third party Vector Tiles by setting the Access Token like this:
VectorTileLayer.ACCESS_TOKEN = " ";
var vectorTileLayer = new VectorTileLayer("mapbox://styles/mapbox/streets-v8");
Is there a way to do this in 4.0 beta 3? There seems to be no mention of using an Access Token in the API documentation. For now, are we only able to use the listed Esri Vector Tile URLs (World Base Map and 8 JSON style objects) in the documentation?
Solved! Go to Solution.
Ok, this works in 4.0beta3
var tileLyr = new VectorTileLayer({ ACCESS_TOKEN: "YOUR_KEY", url: "mapbox://styles/mapbox/streets-v8" });
I think it should work if you add the token to the URL.
I tried that but it doesn't seem to work that simple. I am not sure of the exact syntax betwee "...streets-v8" and my long access token string. I tried a couple things but nothing worked.
Ok, this works in 4.0beta3
var tileLyr = new VectorTileLayer({ ACCESS_TOKEN: "YOUR_KEY", url: "mapbox://styles/mapbox/streets-v8" });
Fantastic! Works great now. Makes sense, was just a matter of 4.0's syntax. Thank you so very much!
By the way, congrats on the move to Esri.
I have and love your book ArcGIS Web Devlopment. Looking forward to the 4.0 book. Like the format you planed: in-depth coverage of new aspects with multiple samples.
I'll miss your GeoNet blog but will remain a loyal fan of your other blog: odoenet - programming geo . Has been a huge help.
Thanks again for your quick fix and response.
David
FYI, in the final (non-beta) release of 4.0, the ACCESS_TOKEN property will be treated similar to the way it is in 3.15. You will no longer be able to do this:
//This only works in 4.0 beta 3 var tileLyr = new VectorTileLayer({ ACCESS_TOKEN: "YOUR_KEY", url: "mapbox://styles/mapbox/streets-v8" });
Instead, this will be the correct way to accomplish this:
//This is how you set the access token in 4.0 final VectorTileLayer.ACCESS_TOKEN = "YOUR_KEY"; var tileLyr = new VectorTileLayer({ url: "mapbox://styles/mapbox/streets-v8" });
Great! Thank so much Kristian for letting me know. This is quite handy information I'll be using when non-beta 4.0 is released.