Created
December 9, 2015 15:12
-
-
Save nateirwin/41c6bf4dc2f9da2c407d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 0; | |
padding: 0; | |
} | |
#map { | |
bottom: 0; | |
position: absolute; | |
top: 0; | |
width: 100%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var NPMap = { | |
div: 'map', | |
overlays: [{ | |
filter: function(feature) { | |
return feature.properties.park === 'Yellowstone'; | |
}, | |
popup: { | |
title: '{{name}}' | |
}, | |
styles: { | |
point: { | |
'marker-symbol': 'star' | |
} | |
}, | |
type: 'geojson', | |
url: 'http://nationalparkservice.github.io/data/projects/yellowstone_national_park/live/gateway_points_of_interest.geojson' | |
},{ | |
popup: { | |
description: 'The alpha code is {{Code}}', | |
title: '{{Name}}' | |
}, | |
styles: { | |
point: { | |
'marker-color': '#609321', | |
'marker-symbol': 'park' | |
} | |
}, | |
type: 'geojson', | |
url: 'http://nationalparkservice.github.io/data/demo/national_parks.geojson' | |
}] | |
}; | |
(function () { | |
var s = document.createElement('script'); | |
s.src = 'http://www.nps.gov/lib/npmap.js/2.0.0/npmap-bootstrap.js'; | |
document.body.appendChild(s); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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>GeoJSON Layer | Examples | NPMap.js</title> | |
<link href="geojson-layer.css" rel="stylesheet"> | |
</head> | |
<body> | |
<div id="map"></div> | |
<script src="geojson-layer.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment