forked from uafrazier's block: Leaflet Map with a Rectangle
xxxxxxxxxx
<html>
<head>
<title>Leaflet Web Map</title>
<!-- reference to Leaflet CSS -->
<link rel="stylesheet" href="https://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<!-- reference to Leaflet JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.min.js"></script>
<!-- set width and height styles for map -->
<style>
#map {
width: 960px;
height:500px;
}
</style>
</head>
<body>
<!-- place holder for map -->
<div id="map"></div>
<script>
// create map object, tell it to live in 'map' div and give initial latitude, longitude, zoom values
// pass option to turn scroll wheel zoom off
var map = L.map('map',{scrollWheelZoom:false}).setView([43.64701, -79.39425], 15);
// add base map tiles from OpenStreetMap and attribution info to 'map' div
L.tileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// define rectangle geographical bounds
var bounds = [[43.64701, -79.39425], [43.64533, -79.38235]];
// add rectangle passing bounds and some basic styles
L.rectangle(bounds, {color: "red", weight: 1}).addTo(map);
</script>
</body>
</html>
Modified http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js to a secure url
https://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js