-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex3.html
163 lines (140 loc) · 8.92 KB
/
index3.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Bedrock Geology in the state of Georgia</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.css" type="text/css" crossorigin="">
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<link rel="stylesheet" href="style3.css" type="text/css">
<script type="text/javascript">
var map;
function init() {
// create map and set center and zoom level
map = new L.map('mapid');
map.setView([32.1656221, -82.9000751], 7);
// create and add osm tile layer
var osm = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});
osm.addTo(map);
// create Google layer
var google = L.tileLayer('http://mt0.google.com/vt/lyrs=y&hl=en&x={x}&y={y}&z={z}&s=Ga', {
maxZoom: 19,
attribution: '© <a href="http://www.openstreetmap.org/">OpenStreetMap</a> and contributors, under an <a href="http://www.openstreetmap.org/copyright" title="ODbL">open license</a>. Google Maps made by <a href="http://google.com/maps"> Google.</a>'
});
// create the bedrock and roads layers
var bedrock = L.tileLayer.wms('http://localhost:8080/geoserver/geog585/wms', {
layers: 'geog585:GA_Bedrock_FinalProject',
format: 'image/png',
transparent: true
});
var roads = L.tileLayer.wms('http://localhost:8080/geoserver/geog585/wms', {
layers: 'geog585:GeorgiaInterstates',
format: 'image/png',
transparent: true
});
// add basemap and vector layers to the map
roads.addTo(map);
bedrock.addTo(map);
roads.bringToFront(map);
// create variables for basemap and overlays for a button to toggle on/off layers
var basemaps = {
"OSM": osm,
"Google": google
};
var overlays = {
"Georgia Bedrock": bedrock,
"Georgia Interstates": roads
};
L.control.layers(basemaps, overlays).addTo(map);
// define event handler function for click events and register it
function Identify(e) {
// set parameters needed for GetFeatureInfo WMS request
var sw = map.options.crs.project(map.getBounds().getSouthWest());
var ne = map.options.crs.project(map.getBounds().getNorthEast());
var BBOX = sw.x + "," + sw.y + "," + ne.x + "," + ne.y;
var WIDTH = map.getSize().x;
var HEIGHT = map.getSize().y;
var X = Math.trunc(map.layerPointToContainerPoint(e.layerPoint).x);
var Y = Math.trunc(map.layerPointToContainerPoint(e.layerPoint).y);
// compose the URL for the request
var URL = 'http://localhost:8080/geoserver/geog585/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&LAYERS=geog585:GA_Bedrock_FinalProject&QUERY_LAYERS=geog585:GA_Bedrock_FinalProject&BBOX=' + BBOX + '&FEATURE_COUNT=1&HEIGHT=' + HEIGHT + '&WIDTH=' + WIDTH + '&INFO_FORMAT=application%2Fjson&TILED=false&CRS=EPSG%3A3857&I=' + X + '&J=' + Y;
//send GetFeatureInfo as asynchronous HTTP request using jQuery $.ajax
$.ajax({
url: URL,
dataType: "json",
type: "GET",
success: function(data) {
if (data.features.length !== 0) { // at least one feature returned in response
var returnedFeature = data.features[0]; // first feature from response
// Set up popup for clicked feature and open it
var popup = new L.Popup({
maxWidth: 300
});
popup.setContent("<b> Rock type: " + returnedFeature.properties.ROCKTYPE1 + "</b> <br> <b>Unit Age: " + returnedFeature.properties.UNIT_AGE + "</b>");
popup.setLatLng(e.latlng);
map.openPopup(popup);
}
}
});
}
map.addEventListener('click', Identify);
}
</script>
</head>
<body onload="init()">
<h1 id="title">Bedrock Geology in the State of Georgia</h1>
<div id="mapid">
</div>
<div id="docs">
<p>This page shows the geology throughout the state of Georgia. Click on a polygon to reveal the rock type and how old it is!</p>
</div>
<div class="pannel-container">
<div class="panel-side">
<h2>Rock Type Info</h2>
<ul id="RockType_Panel">
<li>To view an informative geologic time scale, <a href="https://www.nps.gov/subjects/geology/time-scale.htm" style="color: #8ebf42">Click Here!</a> </li>
<li>Select a rock type below to learn more about it!</li>
<li><a href="https://en.wikipedia.org/wiki/Alluvium" style="color: #8ebf42">Alluvium</a></li>
<li><a href="https://en.wikipedia.org/wiki/Schist" style="color: #8ebf42">Amphibole Schist</a></li>
<li><a href="https://en.wikipedia.org/wiki/Amphibolite" style="color: #8ebf42">Amphibolite</a></li>
<li><a href="https://en.wikipedia.org/wiki/Sand" style="color: #8ebf42">Beach Sand</a></li>
<li><a href="https://en.wikipedia.org/wiki/Gneiss" style="color: #8ebf42">Biotite Gneiss</a></li>
<li><a href="https://en.wikipedia.org/wiki/Schist" style="color: #8ebf42">Biotite Schist</a></li>
<li><a href="https://en.wikipedia.org/wiki/Charnockite" style="color: #8ebf42">Charnockite</a></li>
<li><a href="https://en.wikipedia.org/wiki/Chert" style="color: #8ebf42">Chert</a></li>
<li><a href="https://en.wikipedia.org/wiki/Clay" style="color: #8ebf42">Clay/Mud</a></li>
<li><a href="https://en.wikipedia.org/wiki/Conglomerate_(geology)" style="color: #8ebf42">Conglomerate</a></li>
<li><a href="https://en.wikipedia.org/wiki/Dolomite_(rock)" style="color: #8ebf42">Dolostone/Dolomite</a></li>
<li><a href="https://en.wikipedia.org/wiki/Sand" style="color: #8ebf42">Dune Sand</a></li>
<li><a href="https://en.wikipedia.org/wiki/Felsic" style="color: #8ebf42">Felsic Metavolcanic Rock</a></li>
<li><a href="https://en.wikipedia.org/wiki/Gabbro" style="color: #8ebf42">Gabbro</a></li>
<li><a href="https://en.wikipedia.org/wiki/Gneiss" style="color: #8ebf42">Gneiss</a></li>
<li><a href="https://en.wikipedia.org/wiki/Granite" style="color: #8ebf42">Granite</a></li>
<li><a href="https://en.wikipedia.org/wiki/Gneiss" style="color: #8ebf42">Granitic Gneiss</a></li>
<li><a href="https://en.wikipedia.org/wiki/Hornfels" style="color: #8ebf42">Hornfels</a></li>
<li><a href="https://en.wikipedia.org/wiki/Limestone" style="color: #8ebf42">Limestone</a></li>
<li><a href="https://en.wikipedia.org/wiki/Gneiss" style="color: #8ebf42">Mafic Gneiss</a></li>
<li><a href="https://en.wikipedia.org/wiki/Mafic" style="color: #8ebf42">Mafic Metavolcanic Rock</a></li>
<li><a href="https://en.wikipedia.org/wiki/Marble" style="color: #8ebf42">Marble</a></li>
<li><a href="https://en.wikipedia.org/wiki/Metasedimentary_rock" style="color: #8ebf42">Metasedimentary Rock</a></li>
<li><a href="https://en.wikipedia.org/wiki/Metavolcanic_rock" style="color: #8ebf42">Metavolcanic Rock</a></li>
<li><a href="https://en.wikipedia.org/wiki/Schist" style="color: #8ebf42">Mica Schist</a></li>
<li><a href="https://en.wikipedia.org/wiki/Mylonite" style="color: #8ebf42">Mylonite</a></li>
<li><a href="https://en.wikipedia.org/wiki/Phyllite" style="color: #8ebf42">Phyllite</a></li>
<li><a href="https://en.wikipedia.org/wiki/Quartzite" style="color: #8ebf42">Quartzite/a></li>
<li><a href="https://en.wikipedia.org/wiki/Sand" style="color: #8ebf42">Sand</a></li>
<li><a href="https://en.wikipedia.org/wiki/Sandstone" style="color: #8ebf42">Sandstone</a></li>
<li><a href="https://en.wikipedia.org/wiki/Schist" style="color: #8ebf42">Schist</a></li>
<li><a href="https://en.wikipedia.org/wiki/Shale" style="color: #8ebf42">Shale</a></li>
<li><a href="https://en.wikipedia.org/wiki/Syenite" style="color: #8ebf42">Syenite</a></li>
<li><a href="https://en.wikipedia.org/wiki/Layered_intrusion" style="color: #8ebf42">Ultramafic Intrusive Rock</a></li>
<li><a href="https://en.wikipedia.org/wiki/Superficial_deposits" style="color: #8ebf42">Unconsolidated Deposit</a></li>
<li><a href="https://en.wikipedia.org/wiki/Water" style="color: #8ebf42">Water</a></li>
</ul>
</div>
</div>
</body>
</html>