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([
// if no features are returned, then close the popup
var id = null;
if (response.results.length) {
var feature = response.results.filter(function(result) {
return result.graphic.layer === layer;
})[0].graphic;
feature.popupTemplate = layer.popupTemplate;
id = feature.attributes.OBJECTID_12;
// 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]
});
// Is data layer present at location?
// Assume multiple layers, and check all of them, in case
// layer order changes.
var i = 0;
var dataLayerPresent = false;
while( i < response.results.length && ! dataLayerPresent ) {
if( response.results[i].graphic.layer.url == layer.url ) {
// Note data layer is present to stop loop.
dataLayerPresent = true;
var feature = response.results.filter(function(result) {
return result.graphic.layer === layer;
})[i].graphic;
feature.popupTemplate = layer.popupTemplate;
id = feature.attributes.OBJECTID_12;
// 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 {
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