Remove options from widgets in WAB (dev ed)

1049
8
Jump to solution
09-26-2018 02:02 AM
GarethYoung1
New Contributor III

Robert Scheitlin, GISP

How do you go about removing/disabling some options from some widgets (e.g. share widget) in dev ed of WAB (e.g.)

Select URL parameters included in the link
Current map extent
Click the map to define the center of the map with zoom level
Click the map to define the center of the map with map scale
Find the location or feature and zoom to it
Query a feature and zoom to it
Add a marker on the map
Overwrite default screen size of mobile layout
Set display language of the app
Tags (1)
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Q. From the layer list widget, the description option in the dropdown menu?

A. This is a setting in the LayerList widget settings dialog.

Q. From the add data widget, the vector tile option and kml from the type menu

A. 

1. In the AddData\search\templates\TypeOptions.html make this change:

      <label for="${id}_kmlId" class="search-type-option"
        data-dojo-attach-point="kmlNode">
        <input id="${id}_kmlId"
          data-dojo-type="dijit/form/CheckBox"
          data-dojo-attach-point="kmlToggle"
          data-dojo-attach-event="onClick: optionClicked"
          data-option-q='type:&quot;KML&quot;'/>
        ${i18n.search.typeOptions.kml}
      </label>

2. In the AddData\search\TypeOptions.js postCreate method make this change:

      postCreate: function() {
        this.inherited(arguments);

        if (!VectorTileLayer || !VectorTileLayer.supported()) {
          console.warn("AddData: Vector Tile is not supported.");
          this.vectorTileNode.style.display = "none";
        }

        this.own(on(this.tooltipDialog, "open", lang.hitch(this, function() {
          var v = this.searchPane.wabWidget.appConfig.theme.name;
          this.tooltipDialog.domNode.className += " " + v;
        })));
        this.vectorTileNode.style.display = "none";
        this.kmlNode.style.display = "none";
      },

Q.  From the add data widget, under the URL tab, the options for kml, georss and csv

A.  In the AddData\search\templates\AddFromUrlPane.html make this change:

<div class="secondary-pane add-url-pane">
  <div class="add-url-pane-container">
    <div class="add-url-pane-container--inner">
      <label for="${id}_select">${i18n.addFromUrl.type}</label>
      <select id="${id}_select"
        data-dojo-type="dijit/form/Select" data-dojo-attach-point="typeSelect">
        <option value="ArcGIS" selected="selected">${i18n.addFromUrl.types.ArcGIS}</option>
        <option value="WMS">${i18n.addFromUrl.types.WMS}</option>
        <!--not yet supported <option value="WMTS">${i18n.addFromUrl.types.WMTS}</option> -->
        <!--not yet supported <option value="WFS">${i18n.addFromUrl.types.WFS}</option> -->
        <!-- <option value="KML">${i18n.addFromUrl.types.KML}</option>
        <option value="GeoRSS">${i18n.addFromUrl.types.GeoRSS}</option>
        <option value="CSV">${i18n.addFromUrl.types.CSV}</option> -->
      </select>
...

View solution in original post

0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus

Gareth,

   Some (which ones) or all?

0 Kudos
GarethYoung1
New Contributor III

Robert,

I'd like to customise most of them although don't want to be continually asking questions.  Is the content mainly in one file for each widget?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Gareth,

  Each widget will be different, depending on what option you want to remove. Most widget will require editing the Widget.js and/or Widget.html file though.

GarethYoung1
New Contributor III

Robert,

I'd like to remove some options from the default share widget (e.g.)

Set display language of the app

Any assistance would be greatly appreciated.

Gareth

0 Kudos
GarethYoung1
New Contributor III

Robert,

How do you remove the following options:

From the layer list widget, the description option in the dropdown menu?

From the add data widget, the vector tile option and kml from the type menu?

From the add data widget, under the URL tab, the options for kml, georss and csv?

Thanks

Gareth

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Q. From the layer list widget, the description option in the dropdown menu?

A. This is a setting in the LayerList widget settings dialog.

Q. From the add data widget, the vector tile option and kml from the type menu

A. 

1. In the AddData\search\templates\TypeOptions.html make this change:

      <label for="${id}_kmlId" class="search-type-option"
        data-dojo-attach-point="kmlNode">
        <input id="${id}_kmlId"
          data-dojo-type="dijit/form/CheckBox"
          data-dojo-attach-point="kmlToggle"
          data-dojo-attach-event="onClick: optionClicked"
          data-option-q='type:&quot;KML&quot;'/>
        ${i18n.search.typeOptions.kml}
      </label>

2. In the AddData\search\TypeOptions.js postCreate method make this change:

      postCreate: function() {
        this.inherited(arguments);

        if (!VectorTileLayer || !VectorTileLayer.supported()) {
          console.warn("AddData: Vector Tile is not supported.");
          this.vectorTileNode.style.display = "none";
        }

        this.own(on(this.tooltipDialog, "open", lang.hitch(this, function() {
          var v = this.searchPane.wabWidget.appConfig.theme.name;
          this.tooltipDialog.domNode.className += " " + v;
        })));
        this.vectorTileNode.style.display = "none";
        this.kmlNode.style.display = "none";
      },

Q.  From the add data widget, under the URL tab, the options for kml, georss and csv

A.  In the AddData\search\templates\AddFromUrlPane.html make this change:

<div class="secondary-pane add-url-pane">
  <div class="add-url-pane-container">
    <div class="add-url-pane-container--inner">
      <label for="${id}_select">${i18n.addFromUrl.type}</label>
      <select id="${id}_select"
        data-dojo-type="dijit/form/Select" data-dojo-attach-point="typeSelect">
        <option value="ArcGIS" selected="selected">${i18n.addFromUrl.types.ArcGIS}</option>
        <option value="WMS">${i18n.addFromUrl.types.WMS}</option>
        <!--not yet supported <option value="WMTS">${i18n.addFromUrl.types.WMTS}</option> -->
        <!--not yet supported <option value="WFS">${i18n.addFromUrl.types.WFS}</option> -->
        <!-- <option value="KML">${i18n.addFromUrl.types.KML}</option>
        <option value="GeoRSS">${i18n.addFromUrl.types.GeoRSS}</option>
        <option value="CSV">${i18n.addFromUrl.types.CSV}</option> -->
      </select>
...
0 Kudos
GarethYoung1
New Contributor III

Thanks Robert.  This was very helpful.  Your assistance is much appreciated

0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Don’t forget to mark this question as answered by clicking on the mark correct link on the reply that answered your question.


0 Kudos