I am trying to create a tap/touch on a feature to handle some action. It works on the Chrome browser. But when I install the apk on the Android phone/tablet it does not work.
My environment:
- Cordova 8
- Angular 6
- Open Layers 4.5
this.map.on('singleclick', (evt) => {
//console.log("map clicked");
let coord = this.map.getEventCoordinate(evt.originalEvent);
let feature = this.map.forEachFeatureAtPixel(evt.pixel,
(feature) => {
//console.log("Feature found on click!")
return feature;
}, {hitTolerance: 10});
if (feature) {
var coordinates = feature.getGeometry().getCoordinates();
//console.log("Feature Clicked: " + feature.getId() + "("+ feature.name +")"+ " [ " + coordinates[0] + ", " + coordinates[1] + " ]");
this.toggleTooltip(feature, true);
}
else {
//console.log("Feature not found on click");
this.toggleTooltip(null, null);
}
feature.changed();
});
I tried using hitTolerance
but without any luck.
Please help!