Skip to content

Commit

Permalink
Updated missed references to defaultLayer
Browse files Browse the repository at this point in the history
Updated default -> suggested
  • Loading branch information
ajbeaven committed Aug 30, 2013
1 parent 06f0f6c commit 9a6f635
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Control.MiniMapLayerSwitcher.js
Expand Up @@ -266,19 +266,19 @@ L.Control.MiniMapLayerSwitcher = L.Control.extend({
suggestedLayerId = this._layers[0].id;
suggestedMiniMapContainer = this._getMiniMapContainer(suggestedLayerId);

this._defaultLayerId = suggestedLayerId;
this._suggestedLayerId = suggestedLayerId;
this._activeLayerId = newActiveLayerId;

// set classes for the relevant minimaps
this._forEachLayer(function (layerObj) {
mapContainer = this._getMiniMapContainer(layerObj.id);

L.DomUtil.removeClass(mapContainer, 'active-map');
L.DomUtil.removeClass(mapContainer, 'default-map');
L.DomUtil.removeClass(mapContainer, 'suggested-map');
});

L.DomUtil.addClass(newActiveMiniMapContainer, 'active-map');
L.DomUtil.addClass(suggestedMiniMapContainer, 'default-map');
L.DomUtil.addClass(suggestedMiniMapContainer, 'suggested-map');

// maps cannot share the same layer, so remove the layers from any map
this._map.removeLayer(lastActiveLayer.mainMapLayer);
Expand Down Expand Up @@ -396,7 +396,7 @@ L.Control.MiniMapLayerSwitcher = L.Control.extend({
},

_updateMiniMaps: function () {
var defaultLayerId = this._defaultLayerId,
var suggestedLayerId = this._suggestedLayerId,
isExpanded = L.DomUtil.hasClass(this._container, 'expanded');

// touch devices can have the container open while scrolling the map
Expand All @@ -405,7 +405,7 @@ L.Control.MiniMapLayerSwitcher = L.Control.extend({
this._updateMiniMapPosition(layerObj.id);
}, this);
} else {
this._updateMiniMapPosition(defaultLayerId);
this._updateMiniMapPosition(suggestedLayerId);
}
},

Expand Down

0 comments on commit 9a6f635

Please sign in to comment.