Skip to content

Commit cdc8066

Browse files
committed
fix url bugs
1 parent 71a8f96 commit cdc8066

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/services/Utility/flyToMapPosition.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export const flyToMapPosition = ({
1010

1111
const map = mapRef.default.getMap();
1212

13-
// Remove old marker
13+
map.setMaxZoom(22);
14+
1415
if (map.getSource("location-icon")) {
1516
map.removeLayer("location-icon-layer");
1617
map.removeSource("location-icon");
@@ -48,7 +49,7 @@ export const flyToMapPosition = ({
4849
"icon-offset": [0, -15],
4950
},
5051
});
51-
}
52+
},
5253
);
5354
}
5455

@@ -64,8 +65,7 @@ export const flyToMapPosition = ({
6465

6566
if (!rotate) return;
6667

67-
// Rotate after reaching position
68-
setTimeout(() => {
68+
map.once("moveend", () => {
6969
let rotation = 0;
7070

7171
const rotateCamera = () => {
@@ -77,5 +77,5 @@ export const flyToMapPosition = ({
7777
};
7878

7979
rotateCamera();
80-
}, 3000);
80+
});
8181
};

0 commit comments

Comments
 (0)