Initialize a map with feature layer filtered

2335
2
Jump to solution
05-26-2016 05:24 AM
albavoli
New Contributor III

How can we initialize a map in qml with a feature layer that is already filtered?

0 Kudos
1 Solution

Accepted Solutions
LucasDanzinger
Esri Frequent Contributor

Are you wanting to use a definition expression? - ArcGIS Runtime SDK for Qt QML API: FeatureLayer Class Reference

It should apply any definition expression you have set in the service automatically, but if it does not, then the workaround I can think of is to fetch the feature service info (http://developersdev.arcgis.com/qt/qml/api-reference/class_service_info_task.html#a6e6f2d90fb96340e7... , and from the feature service info, get the feature layer info for your layer (http://developersdev.arcgis.com/qt/qml/api-reference/class_feature_service_info.html#aa7efab2f879390... ). Once you have the FeatureLayerInfo for your layer, you can obtain the def expression string, and apply it to your layer http://developersdev.arcgis.com/qt/qml/api-reference/class_feature_layer_info.html#a3d3237fca07c8bce...

- Luke

View solution in original post

2 Replies
LucasDanzinger
Esri Frequent Contributor

Are you wanting to use a definition expression? - ArcGIS Runtime SDK for Qt QML API: FeatureLayer Class Reference

It should apply any definition expression you have set in the service automatically, but if it does not, then the workaround I can think of is to fetch the feature service info (http://developersdev.arcgis.com/qt/qml/api-reference/class_service_info_task.html#a6e6f2d90fb96340e7... , and from the feature service info, get the feature layer info for your layer (http://developersdev.arcgis.com/qt/qml/api-reference/class_feature_service_info.html#aa7efab2f879390... ). Once you have the FeatureLayerInfo for your layer, you can obtain the def expression string, and apply it to your layer http://developersdev.arcgis.com/qt/qml/api-reference/class_feature_layer_info.html#a3d3237fca07c8bce...

- Luke

albavoli
New Contributor III

Thank Luke You are always very helpful

0 Kudos