config.json, mapOptions, showLabels

764
7
Jump to solution
09-30-2017 01:10 PM
JaysonLindahl
Occasional Contributor

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?

1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Jayson,

   OK after some testing you need to add this line after line 66 in the jimu.js\LayerInfos\LayerInfoForDefault.js:

 

        this.hideLabels();

View solution in original post

7 Replies
KenBuja
MVP Honored Contributor

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.

JaysonLindahl
Occasional Contributor

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.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Jayson,

  Try commenting out line 130 of the jimu.js\LayerInfos\LayerInfoForDefault.js

0 Kudos
JaysonLindahl
Occasional Contributor

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.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Jayson,

   OK after some testing you need to add this line after line 66 in the jimu.js\LayerInfos\LayerInfoForDefault.js:

 

        this.hideLabels();
JaysonLindahl
Occasional Contributor

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

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

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.

0 Kudos