From e0415d0123c652c57b0940befef264a5bafa000f Mon Sep 17 00:00:00 2001 From: Kerry Date: Thu, 12 May 2022 17:50:13 +0200 Subject: [PATCH] remove unused map util fn (#8573) --- src/utils/location/map.ts | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/src/utils/location/map.ts b/src/utils/location/map.ts index 5627bf5c0e..b3b74d1449 100644 --- a/src/utils/location/map.ts +++ b/src/utils/location/map.ts @@ -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/" +