Skip to content

Instantly share code, notes, and snippets.

@nateirwin
Last active August 29, 2015 14:28
Show Gist options
  • Save nateirwin/46589e88299ad5cd5887 to your computer and use it in GitHub Desktop.
Save nateirwin/46589e88299ad5cd5887 to your computer and use it in GitHub Desktop.
body {
margin: 0;
padding: 0;
}
#map {
bottom: 0;
position: absolute;
top: 0;
width: 100%;
}
var NPMap = {
center: {
lat: 45.3058,
lng: -116.7187
},
div: 'map',
overlays: [{
attribution: 'NPMap Team',
popup: {
title: '{{Description}}'
},
tooltip: '{{Name}}',
type: 'geojson',
url: 'rectangle.geojson'
},{
attribution: 'NPMap Team',
styles: {
'fill': '#d39800',
'fill-opacity': 0.2,
'stroke': '#d39800',
'stroke-opacity': 0.8,
'stroke-width': 3
},
table: 'parks',
tooltip: 'Alpha code: {{unit_code}}',
type: 'cartodb',
user: 'nps'
},{
attribution: 'Land Resources Division',
popup: {
description: 'The alpha code is {{Code}}.',
title: '{{Name}}'
},
styles: {
point: {
'marker-color': '#609321',
'marker-symbol': 'park'
}
},
tooltip: 'Center point for {{Code}}',
type: 'geojson',
url: 'national-parks.geojson'
}],
zoom: 6
};
(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);
})();
<!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>Configuring Tooltips | Examples | NPMap.js</title>
<link href="configuring-tooltips.css" rel="stylesheet">
</head>
<body>
<div id="map"></div>
<script src="configuring-tooltips.js"></script>
</body>
</html>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment