diff --git a/html/layers.js b/html/layers.js
index 7248f86..bf715e4 100644
--- a/html/layers.js
+++ b/html/layers.js
@@ -844,7 +844,7 @@ function createBaseLayers() {
13: { size: [20, 20], offset: [40, 40], comment: 'CLASS_SARTEPIRB' }
};
- var aiscatcher_overlay = new ol.layer.Vector({
+ g.aiscatcherLayer = new ol.layer.Vector({
type: 'overlay',
title: "aiscatcher",
name: "aiscatcher",
@@ -878,7 +878,7 @@ function createBaseLayers() {
});
}
});
- world.push(aiscatcher_overlay);
+ world.push(g.aiscatcherLayer);
}
layers.push(new ol.layer.Group({
diff --git a/html/script.js b/html/script.js
index e7fe4d1..1eba353 100644
--- a/html/script.js
+++ b/html/script.js
@@ -2375,9 +2375,7 @@ function ol_map_init() {
});
// show the hover box
- if (!globeIndex && zoomLvl > 5.5 && enableMouseover) {
- OLMap.on('pointermove', onPointermove);
- }
+ checkPointermove();
}
// Initalizes the map and starts up our timers to call various functions
@@ -5499,17 +5497,32 @@ function onPointermove(evt) {
}
function highlight(evt) {
- const hex = evt.map.forEachFeatureAtPixel(evt.pixel,
+ const feature = evt.map.forEachFeatureAtPixel(evt.pixel,
function(feature, layer) {
- return feature.hex;
+ return feature;
},
{
layerFilter: function(layer) {
- return (layer == iconLayer || layer == webglLayer);
+ return (layer == iconLayer || layer == webglLayer || layer == g.aiscatcherLayer);
},
hitTolerance: 5 * globalScale,
}
);
+ if (!feature) {
+ HighlightedPlane = null;
+ refreshHighlighted();
+ return;
+ }
+ const hex = feature.hex;
+
+ const values = feature.values_;
+ const mmsi = values ? values.mmsi : null;
+ if (hex) {
+ //console.log(hex);
+ }
+ if (mmsi) {
+ //console.log(mmsi);
+ }
if (HighlightedPlane && hex == HighlightedPlane.icao)
return;