-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuckeye-trail.html
115 lines (93 loc) · 4.51 KB
/
buckeye-trail.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<html>
<head>
<title>Buckeye Trail</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<link rel="stylesheet" href="src/leaflet.defaultextent.css" />
<link rel="stylesheet" href="src/easyPrint.css" />
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src="src/leaflet.defaultextent.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="src/leaflet.easyPrint.js"></script>
<script src="src/jQuery.print.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-locatecontrol/v0.24.0/L.Control.Locate.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-locatecontrol/v0.24.0/L.Control.Locate.css' rel='stylesheet' />
<!--[if lt IE 9]>
<link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-locatecontrol/v0.21.0/L.Control.Locate.ie.css' rel='stylesheet' />
<![endif]-->
<script src="src/leaflet.makimarkers.js"></script>
<link rel="stylesheet" href="src/leaflet.awesome-markers.css">
<script src="src/leaflet.awesome-markers.js"></script>
<link rel="stylesheet" href="src/Control.Geocoder.css" />
<script src="src/Control.Geocoder.js"></script>
<style>
#map { top:0; bottom:0; width:100%; }
#footer {
position:absolute;
bottom:20px;
right:20px;
z-index:999;
overflow:auto;
padding:5px;
opacity:0.8;
}
</style>
</head>
<body>
<script src='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-omnivore/v0.2.0/leaflet-omnivore.min.js'></script>
<div id="map"></div>
<div id="footer">
<img src="trails-legend.png" alt="trails" style="width:100px">
</div>
<script>
window.onload = function () {
var Esri_WorldTopoMap = L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community'
});
var Esri_WorldImagery = L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
});
var map = L.map('map');
var runLayer = omnivore.geojson('btrail.geojson')
.on('ready', function() {
map.fitBounds(runLayer.getBounds());
}).addTo(map);
// var test = L.tileLayer('tiles/{z}/{x}/{y}.png', {
// zIndex: 1,
// }).addTo(map);
var OpenStreetMap_BlackAndWhite = L.tileLayer('http://{s}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png', {
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
var baseMaps = {
"Gray Basemap": OpenStreetMap_BlackAndWhite,
"Basemap": Esri_WorldTopoMap,
"Imagery": Esri_WorldImagery
};
var overlayMaps = {
"Buckeye Trail": omnivore.geojson('btrail.geojson')
};
L.control.layers(baseMaps).addTo(map);
L.control.defaultExtent().addTo(map);
L.control.locate().addTo(map);
L.easyPrint().addTo(map);
// L.Control.geocoder().addTo(map);
// L.control.search().addTo(map);
map.on('click', function(e) {
var lat = e.latlng.lat;
var lng = e.latlng.lng;
var popLocation= e.latlng;
var popup = L.popup()
.setLatLng(popLocation)
.setContent('<iframe src="' + 'https://docs.google.com/forms/d/14GeNLfqzgvs8Q0THbb4N-UwWgqofwPPnhOMYRXWIw6s/viewform?entry.39165583&entry.674346904=' + e.latlng.lat + '"' + 'width="380" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen'+ '>' + 'Submit Work Order' + '</iframe>')
.openOn(map);
});
// map.on('click', function(e) { alert('<a href="https://docs.google.com/forms/d/14GeNLfqzgvs8Q0THbb4N-UwWgqofwPPnhOMYRXWIw6s/viewform?entry.39165583&entry.674346904=" + e.latlng.lat>"Submit Work Order"</a>') });
// map.on('click', function(e) { alert(e.latlng.lat + ", " + e.latlng.lng) });
}
</script>
</div>
</body>
</html>