How to set vactorTile Layer as costum basemap?
how can I set a custom vector tile layer as a basemap, so it will appear in the basemap dijit?
When I try to add vector layer as a basemap, it doesn't work because it seems a BaseMapLayer only works with tile based services.
You can add VectorTileLayer as a basemap to the basemapGallery as shown below. You need to specify styleUrl and type properties of the BasemapLayer.
Please use this working app to see how this is done.
We will update the BasemapLayer documentation to show how to add VectorTileLayer as a basemap to the basemapGallery.
Dose nobody have a solution or suggestion to this problem?
I waited some api versions and as I see, there is still not way to ad a vector layer as a basemap.
Hi, thank you so much Undral.
Your code works very well. The problem was, that this isn't documented in the api reference.
Also the above code only adds the layer to the Gallery, but not to the static "basemaps" object, which I also wanted to do. Because I also want to set my vector tile layer as the initial basemap.
So if anyone else got this problem, her is an example code to do this.
The important part is, that you have to set the type to "VectorTile" instead of "VectorTileLayer", wich is needed in the BasemapLayer object.
I think it would be good to add this to the api reference. If this is somewhere in the reference, please show me where I could have found this, thanks.