display only one type of a feature Layer

601
1
Jump to solution
06-12-2017 06:14 AM
SaraEL_MALKI
Occasional Contributor II

Hi guys, I have  a feature layer with two types, by default all the types are displayed,

I am planning to add a checkbox list to check or uncheck the type displayed, I have found the property "types" in featureLayers, and I have tried to use it like that :

featureLayer9 = new FeatureLayer(url+"9", {
mode: FeatureLayer.MODE_ONDEMAND,
outFields: ["*"],
id:"troncon",
visible:true,
types:{"Name":"Normale"}
});

but it didn't work,  all I wanna is the ability to extract the type of every single row in a feature layer, Can you help me ?

 types of a feature layer

Thomas Solow‌ Robert Scheitlin, GISP Rebecca Strauch, GISP

https://community.esri.com/community/gis/enterprise-gis/arcgis-for-server?sr=search&searchId=50b2150...

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Sara,

   The Types property is not part of the FeatureLayer constructor so it can not be used in the manner you are attempting. Your best best is to use setDefinitionExpression with a SQL statement that will return only feature included in your type.

View solution in original post

1 Reply
RobertScheitlin__GISP
MVP Emeritus

Sara,

   The Types property is not part of the FeatureLayer constructor so it can not be used in the manner you are attempting. Your best best is to use setDefinitionExpression with a SQL statement that will return only feature included in your type.