Throw error if trying to initialize the same map container twice. Closed #258
This commit is contained in:
parent
98be07c86b
commit
2c540485d2
@ -44,6 +44,11 @@ L.Map = L.Class.extend({
|
|||||||
|
|
||||||
this._container = L.DomUtil.get(id);
|
this._container = L.DomUtil.get(id);
|
||||||
|
|
||||||
|
if (this._container._leaflet) {
|
||||||
|
throw new Error("Map container is already initialized.");
|
||||||
|
}
|
||||||
|
this._container._leaflet = true;
|
||||||
|
|
||||||
this._initLayout();
|
this._initLayout();
|
||||||
|
|
||||||
if (L.DomEvent) {
|
if (L.DomEvent) {
|
||||||
|
Loading…
Reference in New Issue
Block a user