diff --git a/map/client/composables/selection.js b/map/client/composables/selection.js index d31297f4e..a50807f72 100644 --- a/map/client/composables/selection.js +++ b/map/client/composables/selection.js @@ -249,7 +249,7 @@ export function useSelection (name, options = {}) { else handleSelection(items, clearSelection) } function onBoxSelection (map, event) { - lastBoxSelectionPosition = L.point(_.get(event, 'x'), _.get(event, 'y')) + lastBoxSelectionPosition = _.get(event, 'containerPoint') const { bounds } = event let items = getIntersectedItems(bboxPolygon([ bounds.getWest(), bounds.getSouth(), bounds.getEast(), bounds.getNorth() diff --git a/map/client/leaflet/BoxSelection.js b/map/client/leaflet/BoxSelection.js index cca832c66..f58132e31 100644 --- a/map/client/leaflet/BoxSelection.js +++ b/map/client/leaflet/BoxSelection.js @@ -80,7 +80,7 @@ export const BoxSelection = L.Handler.extend({ this._box = L.DomUtil.create('div', 'leaflet-zoom-box', this._container) L.DomUtil.addClass(this._container, 'leaflet-crosshair') - this._map.fire('boxselectionstart') + this._map.fire('boxselectionstart', Object.assign(e, { containerPoint: this._startPoint })) } this._point = this._map.mouseEventToContainerPoint(e) @@ -127,7 +127,7 @@ export const BoxSelection = L.Handler.extend({ this._map.containerPointToLatLng(this._point)) this._map - .fire('boxselectionend', Object.assign(e, { bounds })) + .fire('boxselectionend', Object.assign(e, { bounds, containerPoint: this._map.mouseEventToContainerPoint(e) })) }, _onKeyDown: function (e) {