Skip to content

Commit

Permalink
Map initialization is now idempotent
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed Aug 12, 2013
1 parent ca315e6 commit feb7165
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -33,6 +33,7 @@ CHANGELOG
* Rewrote map initialization, into less flexible and obstruvise way.
* Use plugin system for Leaflet.MiniMap.
* Add ``loadevent`` parameter to ``leaflet_map`` tag.
* Map initialization is now idempotent, does nothing if map is already initialized.


0.6.0 (2013-08-08)
Expand Down
4 changes: 4 additions & 0 deletions leaflet/static/leaflet/leaflet.extras.js
Expand Up @@ -153,6 +153,10 @@ L.Map.DjangoMap = L.Map.extend({


L.Map.djangoMap = function (id, options) {
var container = L.DomUtil.get(id);
if (container._leaflet) // Already initialized
return;

var map = new L.Map.DjangoMap(id, options);

if (options.globals) {
Expand Down

0 comments on commit feb7165

Please sign in to comment.