Changing URL of a Feature Table

382
3
Jump to solution
10-02-2018 01:19 PM
KyleSchultz1
New Contributor II

I have a feature table set up

and a combo box with two values

      ServiceFeatureTable {
                    id: featureTable
                    url: featureUrl
}



                ComboBox {
                    id: departmentBox
                    model: featAttributes
                    function urlChange(){
                        if(departmentBox.currentText=='Water'){
                               featureUrl='/FeatureServer/3'
                        }else if(departmentBox.currentText=='Sewer'){
                            featureUrl='/FeatureServer/1'
                        }
                 
                           }
                    onCurrentIndexChanged:urlChange()
                }


On the change of the combo box I'd like to reload the service feature table to a different feature service.

The method I've tried up here fails 
0 Kudos
1 Solution

Accepted Solutions
ErwinSoekianto
Esri Regular Contributor

You need to get the "operationalLayers" properties from the Map object, Map QML Type | ArcGIS for Developers , then it would return you "LayerListModel" LayerListModel QML Type | ArcGIS for Developers, that you can append or remove Layer object to/from. 

View solution in original post

0 Kudos
3 Replies
ErwinSoekianto
Esri Regular Contributor

Kyle, 

I think you need to have two separate Feature Layers with each ServiceFeatureTable, then add or remove the layer on the ComboBox IndexChanged event listener. 

Looping in ArcGIS Runtime SDK for Qt‌, to see if anyone from that group has more information. 

Thank you,

Erwin

0 Kudos
KyleSchultz1
New Contributor II

Do you know how to properly add or remove a layer? Documentation doesn't specify from what I see 

FeatureLayer QML Type | ArcGIS for Developers 

0 Kudos
ErwinSoekianto
Esri Regular Contributor

You need to get the "operationalLayers" properties from the Map object, Map QML Type | ArcGIS for Developers , then it would return you "LayerListModel" LayerListModel QML Type | ArcGIS for Developers, that you can append or remove Layer object to/from. 

0 Kudos