2011-09-09 17:51:03 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Leaflet debug page</title>
|
|
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
|
|
|
<!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../css/mobile.css" />
|
|
|
|
|
|
|
|
<script src="../leaflet-include.js"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="map"></div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
2012-02-15 23:50:22 +08:00
|
|
|
var map = new L.Map('map');
|
2011-09-09 17:51:03 +08:00
|
|
|
|
2012-02-16 00:23:34 +08:00
|
|
|
var cloudmade = new L.TileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png', {
|
|
|
|
maxZoom: 18,
|
|
|
|
attribution: 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
|
|
|
key: 'BC9A493B41014CAABB98F0471D759707',
|
|
|
|
styleId: 997
|
|
|
|
});
|
2011-09-09 17:51:03 +08:00
|
|
|
|
|
|
|
map.setView(new L.LatLng(51.505, -0.09), 13).addLayer(cloudmade);
|
|
|
|
|
|
|
|
|
|
|
|
var markerLocation = new L.LatLng(51.5, -0.09),
|
|
|
|
marker = new L.Marker(markerLocation);
|
|
|
|
|
|
|
|
map.addLayer(marker);
|
|
|
|
|
|
|
|
marker.bindPopup("<b>Hello world!</b><br />I am a popup.").openPopup();
|
|
|
|
|
|
|
|
|
|
|
|
var circleLocation = new L.LatLng(51.508, -0.11),
|
|
|
|
circleOptions = {
|
|
|
|
color: '#f03',
|
|
|
|
opacity: 0.7
|
|
|
|
},
|
|
|
|
circle = new L.Circle(circleLocation, 500, circleOptions);
|
|
|
|
|
|
|
|
circle.bindPopup("I am a circle.");
|
|
|
|
|
|
|
|
map.addLayer(circle);
|
|
|
|
|
|
|
|
|
|
|
|
var p1 = new L.LatLng(51.509, -0.08),
|
|
|
|
p2 = new L.LatLng(51.503, -0.06),
|
|
|
|
p3 = new L.LatLng(51.51, -0.047),
|
|
|
|
polygonPoints = [ p1, p2, p3 ],
|
|
|
|
polygon = new L.Polygon(polygonPoints);
|
|
|
|
|
|
|
|
polygon.bindPopup("I am a polygon.");
|
|
|
|
|
|
|
|
map.addLayer(polygon);
|
|
|
|
</script>
|
|
|
|
</body>
|
2012-02-15 23:50:22 +08:00
|
|
|
</html>
|