-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathleafletExample.html
42 lines (28 loc) · 1.71 KB
/
leafletExample.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.1.0/dist/leaflet.css"
integrity="sha512-wcw6ts8Anuw10Mzh9Ytw4pylW8+NAD4ch3lqm9lzAsTxg0GFeJgoAtxuCLREZSC5lUXdVyo/7yfsqFjQ4S+aKw=="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.1.0/dist/leaflet.js" integrity="sha512-mNqn2Wg7tSToJhvHcqfzLMU6J4mkOImSPTxVZAdo+lcPlk+GhZmYgACEe0x35K7YzW1zJ7XyJV/TT1MrdXvMcA== "
crossorigin=""></script>
<style type="text/css">
#mapid { height: 180px; }
</style>
</head>
<body>
<div id="mapid" style="width: 600px; height: 400px;"></div>
<script>
var mymap = L.map('mapid').setView([43.653, -79.383], 13);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution:'Map data © <ahref="http://openstreetmap.org">OpenStreetMap</a> contributors, '
+ '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>,'
+ 'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'mapbox.streets' }).addTo(mymap);
L.marker([43.653, -79.383]).addTo(mymap).bindPopup("<b>Downtown Toronto</b><br />").openPopup();
// L.circle([43.653, -79.383], 1000, {color: 'red', fillColor: '#f03', fillOpacity: 0.5 }).addTo(mymap).bindPopup("George's tinder radius.");
//var myPolygon = L.polygon([[51.509, -0.08], [51.503, -0.06], [51.51, -0.047]],{color: 'red',fillColor: '#ff2c28',fillOpacity: 0.5}).addTo(mymap).bindPopup("I am a polygon.");
// L.marker([43.653, -79.383]).addTo(mymap).bindPopup("<b>Hello world!</b><br />I am a popup.").openPopup();
</script>
</body>
</html>