remove unused map util fn (#8573)

t3chguy/dedup-icons-17oct
Kerry 2022-05-12 17:50:13 +02:00 committed by GitHub
parent d87cfae0c9
commit e0415d0123
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 33 deletions

View File

@ -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/" +