CoastalResilienceNetwork / regional-planning

ArcGIS and WMS map layer plugin for the GeositeFramework
0 stars 2 forks source link

If includeAllLayers is set to true, but layer has no children, layer fails to load #58

Open caseycesari opened 7 years ago

caseycesari commented 7 years ago

Encountered while debugging #57

To reproduce:

{ 
        "displayName": "Species Data",
        "server": {
            "type": "ags",
            "layerType": "dynamic",
            "url": "http://dev.services2.coastalresilience.org/arcgis/rest/services/New_York/",
            "name": "NY_CLIMAD_species_maptree",
            "reportGpUrl": "http://dev.services2.coastalresilience.org/arcgis/rest/services/DrawAndReport/getDrawAndReportDataMultiUnits/GPServer/getDrawAndReportDataMultiUnits",
            "reportDbPath": "coastalresilience.gdb" 
        },
        "includeLayers": [
            {
                "name": "Total Predicted Species Richness",
                "displayName": "Species Richness",
                "includeAllLayers": true
            }
        ]
    }
}

Total Predicted Species Richness does not have any children and fails to load because of this check. layer.hasChildren returns true, but serviceLayer.subLayerIds is empty.

kdeloach commented 7 years ago

This seems more like a configuration error than a bug.

kdeloach commented 7 years ago

This problem is essentially the same as using an incorrect URL or layer name. If the config has an invalid value, we won't be able to find that layer in the service.

Fixing the configuration or specifying a layer ID (Ref #55) should resolve the problem.

We should also verify if this is a real issue:

I think setting includeAllLayers: "true" for Total Predicted Species Richness prevented subsequent nested layers from drawing (?)