2011-07-13 01:19:29 +08:00
<!DOCTYPE html>
< html >
< head >
< title > Leaflet debug page< / title >
< link rel = "stylesheet" href = "../../dist/leaflet.css" / >
2012-02-15 16:54:17 +08:00
2011-07-13 01:19:29 +08:00
< link rel = "stylesheet" href = "../css/screen.css" / >
2012-02-15 16:54:17 +08:00
2012-07-26 22:35:09 +08:00
< script src = "../leaflet-include.js" > < / script >
2011-07-13 01:19:29 +08:00
< / head >
< body >
< div id = "map" > < / div >
2017-02-04 23:17:51 +08:00
< script >
2012-02-15 16:54:17 +08:00
2014-03-04 23:54:41 +08:00
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
2014-03-05 00:04:00 +08:00
osmAttrib = '© < a href = "http://openstreetmap.org/copyright" > OpenStreetMap< / a > contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
2014-03-04 23:54:41 +08:00
osm2 = new L.TileLayer(osmUrl, {attribution: 'Hello world'});
2011-07-13 01:19:29 +08:00
2014-03-04 23:54:41 +08:00
var map = new L.Map('map').addLayer(osm).setView(new L.LatLng(50.5, 30.512), 15);
2012-02-15 16:54:17 +08:00
2016-04-25 20:54:02 +08:00
var marker = new L.Marker(new L.LatLng(50.5, 30.505));
2011-07-13 01:19:29 +08:00
map.addLayer(marker);
2013-06-11 20:44:21 +08:00
marker.bindPopup("Leaflet is designed with simplicity, performance and usability in mind. It works efficiently across all major desktop and mobile platforms out of the box, taking advantage of HTML5 and CSS3 on modern browsers while still being accessible on older ones.").openPopup();
2012-02-15 16:54:17 +08:00
2011-07-13 19:49:36 +08:00
var marker2 = new L.Marker(new L.LatLng(50.502, 30.515));
map.addLayer(marker2);
2012-02-15 16:54:17 +08:00
2011-07-13 19:49:36 +08:00
var layersControl = new L.Control.Layers({
2014-03-04 23:54:41 +08:00
'OSM': osm,
'OSM2': osm2
2011-07-13 19:49:36 +08:00
}, {
'Some marker': marker,
'Another marker': marker2
});
2012-02-15 16:54:17 +08:00
2011-07-13 19:49:36 +08:00
map.addControl(layersControl);
2012-02-25 23:04:27 +08:00
map.addControl(new L.Control.Scale());
2011-07-13 01:19:29 +08:00
< / script >
< / body >
2012-02-15 16:54:17 +08:00
< / html >