Skip to content

Instantly share code, notes, and snippets.

@mapsam
Last active December 20, 2015 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mapsam/6175692 to your computer and use it in GitHub Desktop.
Save mapsam/6175692 to your computer and use it in GitHub Desktop.
Leaflet L.marker and .bindPopup()
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<style>
#map {
width:960px;
height:500px;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
window.onload = function () {
var map = L.map('map').setView([43.07573,-89.401047], 15);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
L.marker([43.075695,-89.401052]).addTo(map)
.bindPopup('<strong>Science Hall</strong><br>Where the GISC was born.')
.openPopup();
};
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment