Skip to content

Commit 185225b

Browse files
authored
fix: round zoom level, osm.org will floor it (#324)
1 parent 8b16da5 commit 185225b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/map/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ export const MapComponent = () => {
266266
const handleOpenOSM = useCallback(() => {
267267
if (!mapRef.current) return;
268268
const { lng, lat } = mapRef.current.getCenter();
269-
const zoom = mapRef.current.getZoom();
269+
const zoom = Math.round(mapRef.current.getZoom());
270270
const osmURL = `https://www.openstreetmap.org/#map=${zoom}/${lat}/${lng}`;
271271
window.open(osmURL, '_blank');
272272
}, []);

0 commit comments

Comments
 (0)