Fix strict mode issues
This commit is contained in:
@@ -24,7 +24,7 @@ import { parseGeoUri } from "./parseGeoUri";
|
||||
import { findMapStyleUrl } from "./findMapStyleUrl";
|
||||
import { LocationShareError } from "./LocationShareErrors";
|
||||
|
||||
export const createMap = (interactive: boolean, bodyId: string, onError: (error: Error) => void): maplibregl.Map => {
|
||||
export const createMap = (interactive: boolean, bodyId: string, onError?: (error: Error) => void): maplibregl.Map => {
|
||||
try {
|
||||
const styleUrl = findMapStyleUrl();
|
||||
|
||||
@@ -54,7 +54,7 @@ export const createMap = (interactive: boolean, bodyId: string, onError: (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));
|
||||
onError?.(new Error(LocationShareError.MapStyleUrlNotReachable));
|
||||
});
|
||||
|
||||
return map;
|
||||
|
||||
Reference in New Issue
Block a user