Last active
August 29, 2015 14:06
-
-
Save MappingKat/4ab268164c47a1063f59 to your computer and use it in GitHub Desktop.
Events
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 el = document.getElementById('events'), | |
NPMap; | |
function addMessage(message) { | |
el.innerHTML += message + '<br>'; | |
el.scrollTop = el.scrollHeight; | |
} | |
NPMap = { | |
div: 'map', | |
events: [{ | |
fn: function() { | |
addMessage('movend'); | |
}, | |
type: 'moveend' | |
}], | |
maxZoom: 13, | |
overlays: [{ | |
attribution: 'NPMap Team', | |
events: [{ | |
fn: function(error) { | |
addMessage(error.message); | |
}, | |
type: 'error' | |
},{ | |
fn: function() { | |
addMessage('ready'); | |
}, | |
type: 'ready' | |
},{ | |
fn: function() { | |
addMessage('tileloadstart'); | |
}, | |
type: 'tileloadstart' | |
}], | |
name: 'Parks', | |
popup: { | |
description: { | |
format: 'table' | |
}, | |
title: '{{alphacode}}' | |
}, | |
styles: { | |
'fill': '#7c117c' | |
}, | |
table: 'parks', | |
type: 'cartodb', | |
user: 'nps' | |
}] | |
}; | |
(function() { | |
var s = document.createElement('script'); | |
s.src = 'http://www.nps.gov/npmap/npmap.js/2.0.0/npmap-bootstrap.min.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> Examples | NPMap.js</title> | |
<link rel='stylesheet' href='style.css'> | |
</head> | |
<body> | |
<div id="map"></div> | |
<div id="events"></div> | |
<script src='app.js'></script> | |
</body> | |
</html> |
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%; | |
} | |
#events { | |
background-color: #fff; | |
height: 200px; | |
left: 50%; | |
margin-left: -150px; | |
overflow: auto; | |
padding: 15px; | |
position: absolute; | |
top: 10px; | |
width: 300px; | |
z-index: 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment