UNPKG

leaflet-plugins

Version:

Miscellaneous plugins for Leaflet library for services that need to display route information and need satellite imagery from different providers

21 lines (18 loc) 732 B
<html> <head> <title>Leaflet</title> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" /> <script src="leaflet-src.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'); L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' }).addTo(map); var railroadsLayer = new L.KML('https://raw.githubusercontent.com/f00dl3/Samples/master/RadarB.kml').addTo(map); railroadsLayer.on("loaded", function(e) { map.fitBounds(e.target.getBounds()); }); map.addLayer(railroadsLayer); </script>