Fix strict mode issues
parent
d0e9331f07
commit
de864f15bc
|
@ -24,7 +24,7 @@ import { parseGeoUri } from "./parseGeoUri";
|
||||||
import { findMapStyleUrl } from "./findMapStyleUrl";
|
import { findMapStyleUrl } from "./findMapStyleUrl";
|
||||||
import { LocationShareError } from "./LocationShareErrors";
|
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 {
|
try {
|
||||||
const styleUrl = findMapStyleUrl();
|
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",
|
"Failed to load map: check map_style_url in config.json has a " + "valid URL and API key",
|
||||||
e.error,
|
e.error,
|
||||||
);
|
);
|
||||||
onError(new Error(LocationShareError.MapStyleUrlNotReachable));
|
onError?.(new Error(LocationShareError.MapStyleUrlNotReachable));
|
||||||
});
|
});
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
|
|
Loading…
Reference in New Issue