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

Commit

Permalink
remove unused map util fn (#8573)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerry authored May 12, 2022
1 parent d87cfae commit e0415d0
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/utils/location/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,39 +63,6 @@ export const createMarker = (coords: GeolocationCoordinates, element: HTMLElemen
return marker;
};

export const createMapWithCoords = (
coords: GeolocationCoordinates,
interactive: boolean,
bodyId: string,
markerId: string,
onError: (error: Error) => void,
): maplibregl.Map => {
try {
const map = createMap(interactive, bodyId, onError);

const coordinates = new maplibregl.LngLat(coords.longitude, coords.latitude);
// center on coordinates
map.setCenter(coordinates);

const marker = createMarker(coords, document.getElementById(markerId));
marker.addTo(map);

map.on('error', (e) => {
logger.error(
"Failed to load map: check map_style_url in config.json has a "
+ "valid URL and API key",
e.error,
);
onError(new Error(LocationShareError.MapStyleUrlNotReachable));
});

return map;
} catch (e) {
logger.error("Failed to render map", e);
onError(e);
}
};

const makeLink = (coords: GeolocationCoordinates): string => {
return (
"https://www.openstreetmap.org/" +
Expand Down

0 comments on commit e0415d0

Please sign in to comment.