Select to view content in your preferred language

Trying to set basemap to wms with components

68
1
Wednesday
diffmarc
Emerging Contributor

Hello,

 

I wanted to migrate an application to arcgis components and have some trouble with setting a basemap from a WMS. 

In the html I create <arcgis-map> component and then wanted to create a BaseMap from a WMSLayer object and set the arcgis-map's basemap property to said BaseMap object. Now I get the following error: [esri.core.accessorSupport.ensureTypes] Accessor#set Assigning an instance of 'esri.Basemap' which is not a subclass of 'esri.Basemap'

Note that I am loading the API (4.31) from a local folder and the componets library through a link ("https://js.arcgis.com/map-components/4.31/arcgis-map-components.esm.js").

 

I got a similar problem when trying to add a layer to the map through the addLayer function of the map component. I always get this error: esri.WebMap] #add() The item being added is not a Layer or a Promise that resolves to a Layer. 

But i guess that's another story. 

 

Thanks in advance.

 

Greetings,

 

Marc

 

0 Kudos
1 Reply
AnneFitz
Esri Regular Contributor

Hi Marc - could you share a codepen or snippet that reproduces the issue you are running into? 

Here is an example that uses map components with the WMSLayer as the basemap. Hope this helps! https://codepen.io/annefitz/pen/yyBvZQv

 

0 Kudos