Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setUpTangramLayer: function (map) {
var leafletLayer = Tangram.leafletLayer(this.options).addTo(map);
var self = this;
leafletLayer.scene.subscribe({
// Check for existing API key at load (before scene renders)
load: function (scene) {
var keyForTile = self.options.apiKey;
// If a key has been set (via options.apiKey),
// inject the key into any scene file calling Mapzen vector tiles.
// This will overwrite any existing API keys set in the scene file.
if (keyForTile) {
self._injectApiKey(scene.config, keyForTile);
return;
}
// If no key has been set, make sure key already exists in scene file