How to use the tangram/dist/tangram.debug.leafletLayer function in tangram

To help you get started, we’ve selected a few tangram examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nextzen / nextzen.js / src / js / components / tangram.js View on Github external
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