Throw error if trying to initialize the same map container twice. Closed #258

This commit is contained in:
mourner 2011-10-28 12:23:42 +03:00
parent 98be07c86b
commit 2c540485d2

View File

@ -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) {