Can someone provide an example for toggling FeatureLayers on/off?
I would also like to ave the option of switching between my basemaps that are LocalTiledLayers, is this possible?
I thought I saw an example but I cannot find it now.
Thanks,
PW
Solved! Go to Solution.
The Simple Renderer Online sample was the one I was looking for.
Add a check box for each layer:
CheckBox {
id: topoCheckBox
text: qsTr("Topo")
checked: true
onCheckedChanged: {
updateVisibility(topo, checked);
}
}
Include the function:
function updateVisibility(layerId, visible) {
layerId.visible = visible;
}
Seems to work fine with ArcGISTiledMapServiceLayer, ArcGISLocalTiledLayer, and FeatureLayer
PW
The Simple Renderer Online sample was the one I was looking for.
Add a check box for each layer:
CheckBox {
id: topoCheckBox
text: qsTr("Topo")
checked: true
onCheckedChanged: {
updateVisibility(topo, checked);
}
}
Include the function:
function updateVisibility(layerId, visible) {
layerId.visible = visible;
}
Seems to work fine with ArcGISTiledMapServiceLayer, ArcGISLocalTiledLayer, and FeatureLayer
PW