Skip to content

Commit

Permalink
Allow a configurable hitTolerance (#680)
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika committed Mar 8, 2024
1 parent 346d085 commit bd85035
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/view/main/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ Ext.define('CpsiMapview.view.main.Map', {
mapViewConfig: {
projection: 'EPSG:3857',
zoom: 10,
center: [-890555.9263461886, 7076025.276180581] // ol.proj.fromLonLat([-8, 53.5])
center: [-890555.9263461886, 7076025.276180581], // ol.proj.fromLonLat([-8, 53.5])
// the number of pixels used for 'cmv-mapclick' tolerance
// 0 is the OpenLayers default
// see https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html#forEachFeatureAtPixel
hitTolerance: 0
},

/**
Expand Down Expand Up @@ -311,6 +315,9 @@ Ext.define('CpsiMapview.view.main.Map', {
function (feature, layer) {
// collect all clicked features and their layers
clickedFeatures.push({ feature: feature, layer: layer });
},
{
hitTolerance: me.mapViewConfig.hitTolerance
}
);

Expand Down

0 comments on commit bd85035

Please sign in to comment.