Select to view content in your preferred language

Adding FeatureServer to the map

298
1
02-24-2023 07:53 PM
Aeseir
by
Occasional Contributor

I have a featureserver with url "https://<url_omitted>/FeatureServer".

I want to be able to load that into my map, with all the associated layers.

 

What is the way to do this?

 

Currently i am having to poll the server, get each layer and create using FeatureLayer. Which is a pain as I need to consider hierarchies and more.

0 Kudos
1 Reply
ReneRubalcava
Frequent Contributor II

You can use Layer.fromArcGISServerUrl(), and it will load all the layers in the feature service.

https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromArcGISServe...