Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit e0415d0

Browse files
author
Kerry
authored
remove unused map util fn (#8573)
1 parent d87cfae commit e0415d0

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

src/utils/location/map.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -63,39 +63,6 @@ export const createMarker = (coords: GeolocationCoordinates, element: HTMLElemen
6363
return marker;
6464
};
6565

66-
export const createMapWithCoords = (
67-
coords: GeolocationCoordinates,
68-
interactive: boolean,
69-
bodyId: string,
70-
markerId: string,
71-
onError: (error: Error) => void,
72-
): maplibregl.Map => {
73-
try {
74-
const map = createMap(interactive, bodyId, onError);
75-
76-
const coordinates = new maplibregl.LngLat(coords.longitude, coords.latitude);
77-
// center on coordinates
78-
map.setCenter(coordinates);
79-
80-
const marker = createMarker(coords, document.getElementById(markerId));
81-
marker.addTo(map);
82-
83-
map.on('error', (e) => {
84-
logger.error(
85-
"Failed to load map: check map_style_url in config.json has a "
86-
+ "valid URL and API key",
87-
e.error,
88-
);
89-
onError(new Error(LocationShareError.MapStyleUrlNotReachable));
90-
});
91-
92-
return map;
93-
} catch (e) {
94-
logger.error("Failed to render map", e);
95-
onError(e);
96-
}
97-
};
98-
9966
const makeLink = (coords: GeolocationCoordinates): string => {
10067
return (
10168
"https://www.openstreetmap.org/" +

0 commit comments

Comments
 (0)