cmndrbensisko / LocalLayer

The LocalLayer Widget for ArcGIS Web AppBuilder is intended to allow the direct addition of ArcGIS for Server Mapservices to an ArcGIS Web AppBuilder application, without needing to wrap the desired services in an ArcGIS Online/Portal Web Map.
MIT License
55 stars 26 forks source link

Layer name is not honoured in the UI, when working with feature layers #26

Closed slead closed 9 years ago

slead commented 9 years ago

I'm finding that the name specified for a feature layer is not sticking in the Layer List widget.

To reproduce, update the name of the sample Land Use feature layer under C:\arcgis-web-appbuilder-1.0\server\apps\XXX\configs\LocalLayer\config_Local Layer Widget.json and note that this is not used in the UI.

I can see that lOptions.id is correctly set to the value from the config file, but this value isn't used in the Layer List widget (instead it seems to use the name from the REST API).

This problem doesn't apply to Dynamic or Tiled layers.

rscheitlin commented 9 years ago

Adam, I think this is something you are going to have to work your LayerInfos magic on.

cmndrbensisko commented 9 years ago

It looks like the Esri API likes to ignore the name you set in the initialization options for Feature Layers, opting to re-fetch it from the service when it gets loaded. I've tucked in a hotfix that overwrites the name when the layer's loaded with whatever's been defined in the config file.