Turns out we don't need an interaction to catch feature clicks.
This commit is contained in:
parent
54dc91adc5
commit
986c910a73
|
@ -397,24 +397,21 @@ 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;
|
||||
OLMap.on(['click', 'dblclick'], function(evt) {
|
||||
var hex = evt.map.forEachFeatureAtPixel(evt.pixel,
|
||||
function(feature, layer) {
|
||||
return feature.hex;
|
||||
},
|
||||
null,
|
||||
function(layer) {
|
||||
return (layer === iconsLayer);
|
||||
},
|
||||
null);
|
||||
if (hex) {
|
||||
selectPlaneByHex(hex, (evt.type === 'dblclick'));
|
||||
evt.stopPropagation();
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
// Add home marker if requested
|
||||
if (SitePosition) {
|
||||
|
|
Loading…
Reference in a new issue