ArcGisServerRest Layer (Dynamic)
This example shows how you can easily add a “dynamic” ArcGisServerRest layer to a NPMap web map. ArcGisServerRest layers get display and identify support, out of the box.
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',
div: 'example-map',
layers: [{
identify: {
content: '{{Blurb}}',
simpleTree: true,
title: '{{ParkName}}'
},
layers: 'all',
name: 'National Parks',
opacity: 0.7,
tiled: false,
type: 'ArcGisServerRest',
url: 'http://mapservices.nps.gov/ArcGIS/rest/services/WSDParks/MapServer'
}]
};
(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>