Select to view content in your preferred language

Layer list

3336
3
08-15-2014 09:43 AM
KeisukeNozaki
Frequent Contributor

Here is a layer list widget provided by WebApp Builder Beta.

Clipboard01.png

It is not always easy to turn on and off on mobile devices.

Is there a way to enlarge a checkbox?

Or can I have a layer turned on or off by touching layer name?

I appreciate your advice.

3 Replies
RobertScheitlin__GISP
MVP Emeritus

Keisuke,

   The check box that the layer list widget uses is sized based on the jimu.css file and the size of the images/checked.png. So yes you could increase the size of the images/checked.png (currently 14x14px) and then adjust the height and width of the .jimu-checkbox .checkbox in the css.

KeisukeNozaki
Frequent Contributor

Thank you.

But it did not work as I expected.

How hard is it to turn on or off a layer by touching layer name?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Keisuke,

  Ok, in the LayerListView.js you need to add a line and a new function.

find this line:

this.own(on(ckSelect.domNode, 'click', lang.hitch(this, this._onCkSelectNodeClick, layerInfo, ckSelect)));

and add this one below it:    

this.own(on(divLabel, 'click', lang.hitch(this, this._onLabelNodeClick, layerInfo, ckSelect)));

Then add this new function:

     _onLabelNodeClick: function(layerInfo, ckSelect, evt) {

      if (ckSelect.checked) {

        ckSelect.setValue(false);

        layerInfo.setTopLayerVisible(false);

      } else {

        ckSelect.setValue(true);

        layerInfo.setTopLayerVisible(true);

      }

      evt.stopPropagation();

    },