Closed wmbeers closed 4 years ago
Fixes will be in https://github.com/wmbeers/cmv-app/tree/Metadata-Fix-Issue-40 branch.
Took some doing to merge to stage and sort out why it wasn't initially working. Changes made for #29 were causing metadata menu item to not show up. I fixed those (under the branch for #29) and merged to Stage. Both issues are now on Stage for testing.
https://repo.fla-etat.org/bugzilla/show_bug.cgi?id=5730
The current method for getting the layer name for a given layer within a service assumes the map service's list of layers will contain the same list of references to layers within the service as we have in t_rest_services_mxd.
The way the LayerControl widget (core CMV) works is it only interrogates ArcGIS Server to get the info it needs to render the control in the widget, and it knows nothing about the rest of our internal configuration (info from t_rest_services_mxd, etc.) We have code in the viewMetadata method that gets the layerName by just using the id (really the index) from the LayerControl widget to as an index into our array. That works fine without folders, because the ids from AGS and indexes in our table are the same. But when you add folders in the mix, the ids from AGS no longer match up with the index from our table.
Two ways come to mind to fix this: