Skip to content

Commit 5c8a052

Browse files
committed
fix: animation
1 parent 5111cf0 commit 5c8a052

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/vendors/Geo.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ function Geo(props) {
534534
if (!(featureEnabled('draw') &&
535535
(pdelete.getActive() || pmove.getActive() ||
536536
pedit.getActive() || ledit.getActive() || fedit.getActive()))
537-
&& layer && layer.get("selectable") === true && feature) { //only fire event if we are not drawing
537+
&& layer && layer.get("selectable") !== false && feature) { //only fire event if we are not drawing
538538
fireEvent('click:feature', {
539539
extent: transformExtent(feature.getGeometry()?.extent_, 'EPSG:3857', 'EPSG:4326') || [],
540540
properties: feature.getProperties() || {},

src/vendors/helpers/Animate.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Zoom from 'ol-ext/featureanimation/Zoom'
1515
import { Point } from 'ol/geom'
1616
import * as easing from 'ol/easing';
1717

18+
const emptyCallback = function () { }
1819
export function parseCoords(coords) {
1920
if (!coords) return []
2021
try {
@@ -33,7 +34,7 @@ export function animateToLocation(map, coords, duration, props = {}) {
3334
return map.getView().animate(Object.assign({ zoom: 15 }, {
3435
center: location,
3536
duration: duration,
36-
}, props), props.callback);
37+
}, props), props.callback || emptyCallback);
3738
}
3839

3940
export function animateToExtent(map, coords, duration, props = {}) {
@@ -42,7 +43,7 @@ export function animateToExtent(map, coords, duration, props = {}) {
4243
map.getView().animate(Object.assign({ zoom: 15 }, {
4344
center: location || fromLonLat(coords),
4445
duration: duration,
45-
}, props), props.callback);
46+
}, props));
4647
}
4748

4849

0 commit comments

Comments
 (0)