How to use the tangram.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 tangrams / tangram-play / src / js / map / map.js View on Github external
function initTangram(pathToSceneFile, sceneBasePath) {
  // Add Tangram Layer
  tangramLayer = Tangram.leafletLayer({
    scene: pathToSceneFile,
    sceneBasePath,
    events: {
      hover: handleInspectionHoverEvent,
      click: handleInspectionClickEvent,
    },
  });

  tangramLayer.addTo(map);

  tangramLayer.scene.subscribe({
    load(event) {
      // Modify the scene config object here. This mutates the original scene
      // config object directly and will not be returned. Tangram does not expect
      // the object to be passed back, and will render with the mutated object.
      // eslint-disable-next-line no-param-reassign