-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathleaflet_map.html
44 lines (37 loc) · 2.07 KB
/
leaflet_map.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
37
38
39
40
41
42
43
44
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha512-07I2e+7D8p6he1SIM+1twR5TIrhUQn9+I6yjqD53JQjFiMf8EtC93ty0/5vJTZGF8aAocvHYNEDJajGdNx1IsQ=="
crossorigin="" />
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha512-A7vV8IFfih/D732iSSKi20u/ooOfj/AGehOKq0f4vLT1Zr2Y+RX7C+w8A1gaSasGtRUZpF/NZgzSAu4/Gc41Lg=="
crossorigin=""></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/src/L.Control.MousePosition.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.css" />
<script src="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.js"></script>
<script src='./cityBoundary.js'></script>
</head>
<body>
<div id="canvas" style="width: 100%; height: 100%;"></div>
<script>
jQuery(document).ready(function () {
var map = L.map('canvas', { zoomControl: true}).setView([33.770050, -118.193741], 12);
//map.setMaxBounds([[84.67351256610522, -174.0234375], //[-58.995311187950925, 223.2421875]]);
map.loadingControl = true;
var layer = new L.TileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { noWrap: true }).addTo(map);
var cityLimits = new L.geoJSON(cityBoundary).addTo(map);
//console.log('cityBoundary',cityBoundary);
var north = L.control({position: "bottomright"});
north.onAdd = function(map)
{
var div = L.DomUtil.create("div", "north arrow");
div.innerHTML = '<img src="./img/north.png" style="width: 80px; height: 60px;">';
console.log('div',div)
return div;
}
north.addTo(map);
L.control.mousePosition({position: 'bottomleft'}).addTo(map);
L.Control.geocoder().addTo(map);
});
</script>
</body>
</html>