-
Notifications
You must be signed in to change notification settings - Fork 0
/
Colonist Towns_OLD.html
49 lines (34 loc) · 1.69 KB
/
Colonist Towns_OLD.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
45
46
47
48
49
<html>
<head>
<title>Test Map</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" crossorigin=""/>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" crossorigin=""></script>
</head>
<body>
<div id="mapid" style="width: 1400px; height: 900px;"></div>
<script src="ColonistTownsGeoJSON.js" type="text/javascript"></script>
<script>
var mymap = L.map('mapid').setView([42.445, -71.68], 8);
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
maxZoom: 18,
id: 'mapbox/satellite-streets-v11',
tileSize: 512,
zoomOffset: -1,
accessToken: 'pk.eyJ1Ijoiam1ja2VlbiIsImEiOiJja2htOG5hOGYwa3V5Mndua2wxNmk0b3IwIn0.mrxqcVZ9RgN7TMVLIOvOzg'
}).addTo(mymap);
//var marker = L.marker([42.44163, -71.68683]).addTo(mymap);
function onEachFeature(feature, layer) {
var popupContent = "";
if (feature.properties && feature.properties.name && feature.properties.popupContent) {
popupContent += ("<b>" + feature.properties.name + "</b>" + "<br><br>");
popupContent += feature.properties.popupContent;
}
layer.bindPopup(popupContent);
}
var testLayer = L.geoJSON(colonistTowns, {
onEachFeature: onEachFeature
}).addTo(mymap);
</script>
</body>
</html>