leaflet-plugins
Version:
Miscellaneous plugins for Leaflet library for services that need to display route information and need satellite imagery from different providers
25 lines (21 loc) • 716 B
HTML
<html>
<head>
<title>Leaflet</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.5.1/dist/leaflet.js"></script>
<script src="../layer/vector/KML.js"></script>
</head>
<body>
<div style="width:100%; height:100%" id="map"></div>
<script type='text/javascript'>
var map = L.map('map', {center: L.latLng(58.4, 43.0), zoom: 11});
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
var track = new L.KML('KML_Samples.kml', {async: true})
.on('loaded', function (e) {
map.fitBounds(e.target.getBounds());
})
.addTo(map);
L.control.layers({}, {'Track':track}).addTo(map);
</script>
</body>
</html>