I have modified the config.json file in my application, adding "showLabels": false to the "mapOptions:" section, but my labels are still displaying on the may when it first opens. I'm trying to get the labels to be turned off when the map initially opens. Is there something I'm missing?
Solved! Go to Solution.
Jayson,
OK after some testing you need to add this line after line 66 in the jimu.js\LayerInfos\LayerInfoForDefault.js:
this.hideLabels();
In your app, there's a directory called "configs" that contains the configuration files that are used. Each configured widget has its own directory which contains the file "config_WidgetName.json".
For example, in my app 10, this is where the configurations for the Add Data widget are stored.
Ken,
I'm not sure what you are trying to tell me here. Yes, there is a config file for the LayerList widget called "config_LayerList.json", but there is nothing in that file for configuring the label state.
Jayson,
Try commenting out line 130 of the jimu.js\LayerInfos\LayerInfoForDefault.js
I gave it a shot, but nothing changed. I have a simple map, with a single layer, the labels configured from within the web map. I have been looking all over. Can't get them to be off initially.
Jayson,
OK after some testing you need to add this line after line 66 in the jimu.js\LayerInfos\LayerInfoForDefault.js:
this.hideLabels();
Wow!! That looks like it works. Thank you sooooo much!! I'm really surprised that the other configuration settings seem to have no effect on the map.
These are the changes that I had made, assuming they would have an effect, but I guess they are not used??
1. \server\apps\14\jimu.js\MapManager.js
a. line 245: changed mapOptions.showLabels to false
b. line 253: changed showLabels to false
2. \server\apps\14\config.json
a. line 233: changed showLabels to false within the map settings
Jayson,
In the past you had to set the showLabels to true in the mapOptions before labels would show. Now it seems to be set to true by default though I can not find it in the code.