ESRI JavaScript API 3: show varouis FeatureLayers in one Layer

1051
8
08-05-2020 04:13 AM
CarstenMalchow
New Contributor

Hi,

I would like to use the FeatureServer of current Hurricanes to display the information in one single Layer.

This means represent the observed Track (Line), observed Position (Point), forcasted Track (Line), forcasted Positions (Point) and Error Cone (Polygon) in once. With a MapServer this is possibale, by using ArcGISDynamicMapServiceLayer and configuering the layerDefinitions. How to achive the same with a FeatureLayer in Frontend?


Kind regards

Carsten

0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus

Carsten,

  You can not. A FeatureServer url is a single layer url and can not be made to act like a MapServer url.

0 Kudos
CarstenMalchow
New Contributor

Hi Robert,

thanks for your replay. How would be a possibale solution?

0 Kudos
CarstenMalchow
New Contributor

or can ic use a group Layer and hide the sub-layer in toc?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Carsten,

  In the 3.x API there is no group layer so there is No solution in 3.x that I am aware of.

0 Kudos
CarstenMalchow
New Contributor

ok so if I just focus on lines e.g. and then I would work with a featureCollection. The source inside the FeatureCollection I would fill up with a addentlion request to the server and query for it.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

??? I don't understand your question at all.

0 Kudos
CarstenMalchow
New Contributor

According the API documentation I would not use the URL direktly, insteadt of I would use the constructor witht FeatureCollectionObject FeatureLayer | API Reference | ArcGIS API for JavaScript 3.33 

The first paramter is  featureCollectionObject, there you can define a source/geometry. This I would like to obtain by performing a query against the Server like this: https://services9.arcgis.com/RHVPKKiFTONKtxq3/ArcGIS/rest/services/Active_Hurricanes_v1/FeatureServe... 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Carsten,

   OK what is your end goal in doing this versus using the url as one normally would?

0 Kudos