Note: The default ITS GitLab runner is a shared resource and is subject to slowdowns during heavy usage.
You can run your own GitLab runner that is dedicated just to your group if you need to avoid processing delays.

Commit 14820a81 authored by Peter Knoop's avatar Peter Knoop
Browse files

Added check to mouse-over popup to limit to dealing with data layer, and...

Added check to mouse-over popup to limit to dealing with data layer, and ignoring other layers, like boundaries.
parent d3cd72e5
...@@ -309,22 +309,35 @@ require([ ...@@ -309,22 +309,35 @@ require([
// if no features are returned, then close the popup // if no features are returned, then close the popup
var id = null; var id = null;
if (response.results.length) { if (response.results.length) {
var feature = response.results.filter(function(result) { // Is data layer present at location?
return result.graphic.layer === layer; // Assume multiple layers, and check all of them, in case
})[0].graphic; // layer order changes.
feature.popupTemplate = layer.popupTemplate; var i = 0;
id = feature.attributes.OBJECTID_12; var dataLayerPresent = false;
// Log feature while( i < response.results.length && ! dataLayerPresent ) {
//console.log(feature); if( response.results[i].graphic.layer.url == layer.url ) {
highlight = layerView.highlight([id]); // Note data layer is present to stop loop.
var selectionId = mainView.popup.selectedFeature dataLayerPresent = true;
? mainView.popup.selectedFeature.attributes.OBJECTID_1 var feature = response.results.filter(function(result) {
: null; return result.graphic.layer === layer;
})[i].graphic;
if (highlight && id !== selectionId) { feature.popupTemplate = layer.popupTemplate;
mainView.popup.open({ id = feature.attributes.OBJECTID_12;
features: [feature] // Log feature
}); //console.log(feature);
highlight = layerView.highlight([id]);
var selectionId = mainView.popup.selectedFeature
? mainView.popup.selectedFeature.attributes.OBJECTID_1
: null;
if (highlight && id !== selectionId) {
mainView.popup.open({
features: [feature]
});
}
} else {
++i;
}
} }
} else { } else {
if (mainView.popup.visible) { if (mainView.popup.visible) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment