Skip to content

Commit c903aec

Browse files
committed
[Map] Fix TypeScript errors
1 parent cd13505 commit c903aec

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Map/src/Bridge/Google/assets/dist/map_controller.js

+3
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ class map_controller extends default_1 {
113113
libraries = ['core', ...libraries.filter((library) => library !== 'core')];
114114
const librariesImplementations = await Promise.all(libraries.map((library) => loader.importLibrary(library)));
115115
librariesImplementations.map((libraryImplementation, index) => {
116+
if (typeof libraryImplementation !== 'object' || libraryImplementation === null) {
117+
return;
118+
}
116119
const library = libraries[index];
117120
if (['marker', 'places', 'geometry', 'journeySharing', 'drawing', 'visualization'].includes(library)) {
118121
_google.maps[library] = libraryImplementation;

src/Map/src/Bridge/Google/assets/src/map_controller.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,16 @@ export default class extends AbstractMapController<
7171
libraries.map((library) => loader.importLibrary(library))
7272
);
7373
librariesImplementations.map((libraryImplementation, index) => {
74+
if (typeof libraryImplementation !== 'object' || libraryImplementation === null) {
75+
return;
76+
}
77+
7478
const library = libraries[index];
7579

7680
// The following libraries are in a sub-namespace
7781
if (['marker', 'places', 'geometry', 'journeySharing', 'drawing', 'visualization'].includes(library)) {
78-
_google.maps[library] = libraryImplementation;
82+
// @ts-ignore
83+
_google.maps[library] = libraryImplementation as any;
7984
} else {
8085
_google.maps = { ..._google.maps, ...libraryImplementation };
8186
}

0 commit comments

Comments
 (0)