Skip to content

Instantly share code, notes, and snippets.

@nateirwin
Last active August 29, 2015 14:27
Show Gist options
  • Save nateirwin/854882485e6e348bd44f to your computer and use it in GitHub Desktop.
Save nateirwin/854882485e6e348bd44f to your computer and use it in GitHub Desktop.
Use NPMap.js' baseLayer presets.
body {
margin: 0;
padding: 0;
}
#map {
bottom: 0;
position: absolute;
top: 0;
width: 100%;
}
var NPMap = {
baseLayers: [
'nps-parkTiles',
'nps-parkTilesImagery',
'nps-parkTilesSlate',
'nps-lightStreets',
'nps-neutralTerrain',
'nps-satelliteNight',
'bing-aerial',
'bing-aerialLabels',
'bing-roads',
'cartodb-darkMatter',
'cartodb-darkMatterNoLabels',
'cartodb-positron',
'cartodb-positronNoLabels',
'esri-gray',
'esri-imagery',
'esri-nationalGeographic',
'esri-oceans',
'esri-streets',
'esri-topographic',
'mapbox-dark',
'mapbox-emerald',
'mapbox-highContrast',
'mapbox-landsatLive',
'mapbox-light',
'mapbox-outdoors',
'mapbox-pencil',
'mapbox-runBikeAndHike',
'mapbox-satellite',
'mapbox-satelliteLabels',
'mapbox-streets',
'mapbox-terrain',
'openstreetmap',
'stamen-terrain',
'stamen-toner',
'stamen-watercolor'
],
div: 'map'
};
(function() {
var s = document.createElement('script');
s.src = 'http://www.nps.gov/lib/npmap.js/2.0.0/npmap-bootstrap.min.js';
document.body.appendChild(s);
})();
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
<title>'baseLayer' Presets | Examples | NPMap.js</title>
<link href="baselayer-presets.css" rel="stylesheet">
</head>
<body>
<div id="map"></div>
<script src="baselayer-presets.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment