We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71a8f96 commit cdc8066Copy full SHA for cdc8066
1 file changed
src/services/Utility/flyToMapPosition.js
@@ -10,7 +10,8 @@ export const flyToMapPosition = ({
10
11
const map = mapRef.default.getMap();
12
13
- // Remove old marker
+ map.setMaxZoom(22);
14
+
15
if (map.getSource("location-icon")) {
16
map.removeLayer("location-icon-layer");
17
map.removeSource("location-icon");
@@ -48,7 +49,7 @@ export const flyToMapPosition = ({
48
49
"icon-offset": [0, -15],
50
},
51
});
- }
52
+ },
53
);
54
}
55
@@ -64,8 +65,7 @@ export const flyToMapPosition = ({
64
65
66
if (!rotate) return;
67
- // Rotate after reaching position
68
- setTimeout(() => {
+ map.once("moveend", () => {
69
let rotation = 0;
70
71
const rotateCamera = () => {
@@ -77,5 +77,5 @@ export const flyToMapPosition = ({
77
};
78
79
rotateCamera();
80
- }, 3000);
+ });
81
0 commit comments