npmap.js
Version:
A JavaScript web mapping library, built as a Leaflet plugin, for the National Park Service.
54 lines (52 loc) • 1.48 kB
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>MapBox Layer | Examples | NPMap.js</title>
<style>
body {
margin: 0;
padding: 0;
}
#map {
bottom: 0;
position: absolute;
top: 0;
width: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var attribution = '<a href="http://mapbox.com/about/maps" target="_blank">MapBox</a>, © <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
NPMap = {
baseLayers: [{
attribution: attribution,
id: 'mapbox.geography-class',
popup: {
description: '<div style="text-align:center;"><img src="data:image/png;base64,{{flag_png}}"></div>',
title: '{{admin}}'
},
tooltip: '{{admin}}',
type: 'mapbox'
}],
div: 'map',
maxZoom: 8,
overlays: [{
attribution: attribution,
clickable: false,
id: 'mapbox.va-quake-aug',
popup: false,
type: 'mapbox'
}]
};
(function() {
var s = document.createElement('script');
s.src = '../dist/npmap-bootstrap.js';
document.body.appendChild(s);
})();
</script>
</body>
</html>