Reinstate selecting aircraft by clicking on their icons.
This commit is contained in:
parent
90f5a7d4e3
commit
fc95719f2e
|
@ -404,6 +404,7 @@ PlaneObject.prototype.updateMarker = function(moved) {
|
|||
}
|
||||
} else {
|
||||
this.marker = new ol.Feature(new ol.geom.Point(ol.proj.fromLonLat(this.position)));
|
||||
this.marker.hex = this.icao;
|
||||
this.marker.setStyle(this.markerStyle);
|
||||
PlaneIconFeatures.push(this.marker);
|
||||
|
||||
|
|
|
@ -390,6 +390,25 @@ function initialize_map() {
|
|||
localStorage['ZoomLvl'] = OLMap.getView().getZoom();
|
||||
});
|
||||
|
||||
OLMap.addInteraction(new ol.interaction.Pointer({
|
||||
handleDownEvent: function(evt) {
|
||||
console.log("down event");
|
||||
var hex = evt.map.forEachFeatureAtPixel(evt.pixel,
|
||||
function(feature, layer) {
|
||||
return feature.hex;
|
||||
},
|
||||
null,
|
||||
function(layer) {
|
||||
return (layer === iconsLayer);
|
||||
},
|
||||
null);
|
||||
if (hex) {
|
||||
selectPlaneByHex(hex);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}));
|
||||
|
||||
// Add home marker if requested
|
||||
if (SitePosition) {
|
||||
console.log("setting up site position");
|
||||
|
|
Loading…
Reference in a new issue