Created
October 10, 2012 21:41
-
-
Save glenrobertson/3868636 to your computer and use it in GitHub Desktop.
Leaflet Map with a marker
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> | |
<title>Leaflet Markers</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4.3/leaflet.css" /> | |
<!--[if lte IE 8]> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4.3/leaflet.ie.css" /> | |
<![endif]--> | |
<script src="http://cdn.leafletjs.com/leaflet-0.4.3/leaflet.js"></script> | |
<style type="text/css"> | |
html, body, #map { | |
margin: 0; | |
padding: 0; | |
width: 100%; | |
height: 100%; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="map"></div> | |
<script type="text/javascript"> | |
var map = new L.Map('map'), | |
cloudmadeUrl = 'http://{s}.tile.cloudmade.com/1a1b06b230af4efdbb989ea99e9841af/997/256/{z}/{x}/{y}.png', | |
cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade'; | |
map.setView(new L.LatLng(-41.2901, 174.8536), 12); | |
var baseLayer = new L.TileLayer(cloudmadeUrl, { attribution: cloudmadeAttribution}); | |
baseLayer.addTo(map); | |
var marker = new L.Marker([-41.2901, 174.8536]); | |
marker.addTo(map); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment