Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Controlling the layer list on the Nearby Widget #36

@gaokai85

Description

@gaokai85

Currently, the Nearby widget will auto populate all layers and sublayers (with data) listed in the viewer.js. Could we change the code so that we could have more control over which layers we include in the Nearby widget? From the Nearby.js file it seems this function creates the drop-down list:

populateLayerSelect: function () { var options = []; array.forEach(this.map.layerIds, lang.hitch(this, function (layerId, i) { if (i !== 0) { if (this.map.getLayer(layerId).layerInfos && this.map.getLayer(layerId).layerInfos.length > 0) { array.forEach(this.map.getLayer(layerId).layerInfos, lang.hitch(this, function (layerInfo, j) { // check to exclude the group layers as they do not contain features if (!layerInfo.subLayerIds) { options.unshift({ value: layerId + ':' + j, label: layerInfo.name }); } })); } else if (this.map.getLayer(layerId).name) { options.unshift({ value: layerId + ':', label: this.map.getLayer(layerId).name }); } } })); this.nearbyFeaturesSelect.addOption(options); this.setupSelectionLayers(this.nearbyFeaturesSelect.get('value')); },

Any quick pointers on how we might approach this would be helpful. If it would be a complex task, that insight would also be helpful. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions