Last active
December 19, 2015 02:49
-
-
Save knownasilya/5885953 to your computer and use it in GitHub Desktop.
Layers model empty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initBaseOverlays: function () { | |
var settings = this.get("settings"), | |
layers = this.get("content"), | |
baseOverlays, | |
apiKey = settings.apiKey, | |
overlayKey, | |
overlay, | |
subtype, | |
result = {}; | |
layers.then(function (loadedLayers) { | |
// loadedLayers is empty | |
baseOverlays = loadedLayers.filterProperty("type", "base"); | |
for(overlayKey in baseOverlays) { | |
overlay = baseOverlays[overlayKey]; | |
type = overlay.get("type"); | |
overlayKey = overlay.get("id"); | |
if(overlayKey !== "none" && type === "base") { | |
result[overlayKey] = new L.BingLayer(apiKey, { | |
name: overlay.get("label") , | |
type: overlay.get("subtype") | |
}); | |
} | |
} | |
this.set("baseLayers", result); | |
}); | |
this.set("defaultBaseLayer", settings.defaults.baseLayer); | |
}.observes("content") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment