Skip to content

Commit

Permalink
feat(query-results): submit wms queries based on layer state
Browse files Browse the repository at this point in the history
Check config to see if queries are allowed; change layer states to
see if individual layers' queries are enabled.
  • Loading branch information
AleksueiR committed Apr 30, 2015
1 parent f8b96c6 commit 89c107c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/js/RAMP/Modules/filterManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ define([
// TODO: temp function; move or connect to the ramp state manager later.
var wmsLayer = RAMP.layerRegistry[evt.checkbox.id];
if (wmsLayer.ramp.config.featureInfo) {
wmsLayer.ramp.state.wmsQuery = evt.checkbox.state;
wmsLayer.ramp.state.queryEnabled = evt.checkbox.state;
}
});

Expand Down
6 changes: 3 additions & 3 deletions src/js/RAMP/Modules/mapClickHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ define([

/**
* This function should be called after the map has been created. It will subscribe to the Map.CLICK event
* and trigger GUI.SUBPANEL_OPEN events for displaying the response data. Tests RAMP.state.ui.wmsQuery to
* and trigger GUI.SUBPANEL_OPEN events for displaying the response data. Tests RAMP.config.ui.mapQueryToggle.show to
* determine if it should process the query or not.
*
* @method registerWMSClick
Expand All @@ -61,7 +61,7 @@ define([
var visibleLayers = [],
rqPromises = [];

if (!RAMP.state.ui.wmsQuery) {
if (!RAMP.config.ui.mapQueryToggle.show) {
return;
}

Expand All @@ -73,7 +73,7 @@ define([
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
wmsLayer.ramp.state.queryEnabled === 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 89c107c

Please sign in to comment.