Map not rendering with Leaflet.js

20 hours ago 1
ARTICLE AD BOX

I'm returning to leaflet.js and I am unable to render the map with the tutorial from "Leaflet Essentials"

When I save the file as an .html and open it, there is a blank webpage. I assumed it should be a map as per the example? Grateful for any pointers, please

The code I am using is as follows:

<!DOCTYPE html> <html> <head><title>Leaflet.js Essentials</title> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" /> </head> <body> <script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script> <div id="map" style="width: 600px; height: 400px"></div> <script> var map = L.map('map', { center: [35.10418, -106.62987], zoom: 10 }); L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(map); </script> </body> </html>
Read Entire Article