AnsweredAssumed Answered

Ways to identify an ArcGISDynamicMapServiceLayer / non-Feature Layer

Question asked by xavierthay on Oct 9, 2014
Latest reply on Oct 10, 2014 by kenbuja

Hi all,

 

currently I am having difficulties identifying the type of object to use when retrieving layers.

This is done in Javascript / JQuery front end & Java MVC / Hibernate controller mid tier.

 

I am hitting a REST service to grab said layer info, majority of the layers are of type "Feature Layers".

Which is loaded from an ARCGis backend and loaded into a new "esri.layers.FeatureLayer" Javascript object.

Like this:

 

var featureLayer = new esri.layers.FeatureLayer(url, { [options] };

 

This however does not work smoothly with other layers (e.g. in particular "Annotation Layers")

 

For Annotation Layers, I need to use the esri.layers.ArcGISDynamicMapServiceLayer(url) Javascript object.

 

var dynamicLayer = new esri.layers.ArcGISDynamicMapServiceLayer(url);

 

--

 

And here lies my problem: I currently have no way to identify if said object is a "Feature Layer" or any other type of Layer.

 

I was wondering if I could load the layer into an ArcGISDynamicMapServiceLayer Object and ues its properties to see if it is indeed a non-Feature Layer, but the methods / fields for the class seem rather lacklustre.

 

--

 

TLDR: Anyone knows of a way of identify an ArcGISDynamicMapServiceLayer layer loaded from REST?

 

Sincerely,

Xavier

Outcomes