Skip to content

Commit

Permalink
feat(map): filter query layers by wms query toggle state
Browse files Browse the repository at this point in the history
Submit queries only to layers that have the wms query toggle
state set to on.
  • Loading branch information
AleksueiR committed Apr 30, 2015
1 parent 16b3d5b commit cd8ea97
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/js/RAMP/Modules/mapClickHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ define([
// filter only currently visible layers
visibleLayers = wmsClickQueue.filter(function (wmsLayer) {
console.log(wmsLayer);
return wmsLayer.visible && wmsLayer.id in RAMP.layerRegistry && RAMP.layerRegistry[wmsLayer.id] && wmsLayer.ramp.loadOk !== false;
// can't use loadOk directly because nothing sets it to true
return wmsLayer.visible &&
wmsLayer.id in RAMP.layerRegistry &&
RAMP.layerRegistry[wmsLayer.id] &&
wmsLayer.ramp.loadOk !== false && // can't use loadOk directly because nothing sets it to true
wmsLayer.ramp.state.wmsQuery === true; // check if wmsQuery toggle is set to true
});

// if no visible layers return early and do not open the panel
Expand Down

0 comments on commit cd8ea97

Please sign in to comment.