We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e64a92a commit 9eb056aCopy full SHA for 9eb056a
packages/maptalks/src/map/Map.ts
@@ -2000,9 +2000,9 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) {
2000
}
2001
2002
2003
- if (this._containerDOM.childNodes && this._containerDOM.childNodes.length > 0) {
2004
- //@ts-expect-error I don't know either
2005
- if (this._containerDOM.childNodes[0].className === 'maptalks-wrapper') {
+ if(this._containerDOM?.childNodes?.length > 0) {
+ const firstChild = this._containerDOM.childNodes[0];
+ if (firstChild instanceof HTMLElement && firstChild.classList.contains('maptalks-wrapper')) {
2006
throw new Error('Container is already loaded with another map instance, use map.remove() to clear it.');
2007
2008
0 commit comments