Turns out we don't need an interaction to catch feature clicks.

This commit is contained in:
Oliver Jowett 2016-07-02 18:11:05 +01:00
parent 54dc91adc5
commit 986c910a73

View file

@ -397,9 +397,7 @@ function initialize_map() {
localStorage['ZoomLvl'] = OLMap.getView().getZoom();
});
OLMap.addInteraction(new ol.interaction.Pointer({
handleDownEvent: function(evt) {
console.log("down event");
OLMap.on(['click', 'dblclick'], function(evt) {
var hex = evt.map.forEachFeatureAtPixel(evt.pixel,
function(feature, layer) {
return feature.hex;
@ -410,11 +408,10 @@ function initialize_map() {
},
null);
if (hex) {
selectPlaneByHex(hex);
selectPlaneByHex(hex, (evt.type === 'dblclick'));
evt.stopPropagation();
}
return false;
}
}));
});
// Add home marker if requested
if (SitePosition) {