Harry Wood
home
>
maps
>
examples
> leaflet >
Leaflet - Just a map
Leaflet - Just a map
A basic leaflet map following the first few steps of their
quick Start tutorial
<html> <head> <title>Leaflet - Just a map</title> <!-- Point at the CDN "hosted" CSS and javascript of leaflet --> <link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" /> <script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script> <style> #map { height: 180px; } </style> <script language="javascript"> function init() { var map = L.map('map'); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© <a href="http://openstreetmap.org">OpenStreetMap</a> contributors', maxZoom: 18 }).addTo(map); map.attributionControl.setPrefix(''); // Don't show the 'Powered by Leaflet' text. var london = new L.LatLng(51.505, -0.09); // geographical point (longitude and latitude) map.setView(london, 13); } </script> </head> <body onLoad="javascript:init();"> <div id="map"></div> </body> </html>
view directly
Home
Blog
About
Maps
Other
Contact