Crater Lake National Park

NPMap

Digital maps for the National Park Service

(Advanced) TileStream Layer

This example demonstrates how to use some of the advanced features of a TileStream server like compositing and interactivity. NPMap supports all of the features of a TileStream server, so you get all of these features, out of the box, when you add one or more TileStream layers to your map.

 

Related resources:

Map

Code


<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
  </head>
  <body>
    <div id="example-map" style="height:500px;position:absolute;width:500px;">
    </div>
    <script>
      var NPMap = NPMap || {};
      
      NPMap.config = {
        api: 'bing',
        baseLayers: false,
        div: 'example-map',
        identify: {
          content: function(data) {
            var html = '<ul>';

            for (var p in data) {
              if (data.hasOwnProperty(p)) {
                html += '<li>' + p + ': ' + data[p] + '</li>';
              }
            }

            return html + '</ul>';
          },
          title: 'Attributes'
        },
        layers: [{
          composited: [{
            id: 'nps.basemap'
          },{
            id: 'nps.Total_Nitrogen_Deposition'
          },{
            id: 'nps.Air_Atlas_Park_Points_Deposition'
          },{
            id: 'nps.Monitors_Deposition'
          },{
            id: 'nps.Air_Atlas_Reference_Deposition'
          }],
          type: 'TileStream'
        }]
      };
      
      (function() {
        var s = document.createElement('script');
        s.src = 'http://www.nps.gov/npmap/1.0.0/bootstrap.js';
        document.body.appendChild(s);
      })();
    </script>
  </body>
</html>