-
Notifications
You must be signed in to change notification settings - Fork 1
/
Recherche2.html
291 lines (258 loc) · 10.4 KB
/
Recherche2.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<!DOCTYPE html>
<html lang="en"><!-- Basic -->
<head>
<base target="_top">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Mobile Metas -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Site Metas -->
<title>Géoportail Des Parcs Nationaux</title>
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="author" content="">
<!-- Site Icons -->
<link rel="shortcut icon" href="Image/georeserve.png" type="image/x-icon">
<link rel="apple-touch-icon" href="Image/">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="Css/bootstrap.min.css">
<!-- Site CSS -->
<link rel="stylesheet" href="Css/style.css">
<!-- Pickadate CSS -->
<link rel="stylesheet" href="Css/classic.css">
<link rel="stylesheet" href="Css/classic.date.css">
<link rel="stylesheet" href="Css/classic.time.css">
<!-- Responsive CSS -->
<link rel="stylesheet" href="Css/responsive.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="Css/custom.css">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"/>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<!-- Load jQuery and PapaParse to read data from a CSV file -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/papaparse@5.3.0/papaparse.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"/>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/papaparse@5.3.0/papaparse.min.js"></script>
<title>Layers Control Tutorial - Leaflet</title>
<link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="Css/leaflet.css"/>
<script src="Js/leaflet.js"></script>
<link rel="stylesheet" href="Css/leaflet.zoomhome.css"/>
<script src="Js/leaflet.zoomhome.min.js"></script>
<!-- Load Leaflet from CDN -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.8.0/dist/leaflet.css" crossorigin="" />
<script src="https://unpkg.com/leaflet@1.8.0/dist/leaflet.js" crossorigin=""></script>
<!-- Load Esri Leaflet from CDN -->
<script src="https://unpkg.com/esri-leaflet@^3.0.8/dist/esri-leaflet.js"></script>
<script src="https://unpkg.com/esri-leaflet-vector@4.0.0/dist/esri-leaflet-vector.js"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Start header -->
<header class="top-navbar">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="index.html">
<img src="images/logogeotourisme.png" alt="" />
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbars-rs-food" aria-controls="navbars-rs-food" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbars-rs-food">
<ul class="navbar-nav ml-auto">
<li class="nav-item"><a class="nav-link" href="index.html">Accueil</a></li>
<li class="nav-item"><a class="nav-link" href="about.html">Informations</a></li>
<li class="nav-item"><a class="nav-link" href="storymap\index1.html" target="_blank">Géoportail</a> </li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="dropdown-a" data-toggle="dropdown">Cartes thématiques</a>
<div class="dropdown-menu" aria-labelledby="dropdown-a">
<a class="dropdown-item" href="Carte des superficies.html">Carte des superficies</a>
<a class="dropdown-item" href="Carte NDVI.html">Carte NDVI</a>
<a class="dropdown-item" href="Visualisation 3D.html" target="_blank">Visualisation 3D</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="dropdown-a" data-toggle="dropdown">Recherche</a>
<div class="dropdown-menu" aria-labelledby="dropdown-a">
<a class="dropdown-item" href="Recherche.html">Attributaires</a>
<a class="dropdown-item" href="Recherche2.html">Spatiales</a>
<a class="dropdown-item" href="Itinéraire.html">Itinéraire</a>
</div>
</li>
<li class="nav-item"><a class="nav-link" href="contact.html">Contact</a></li>
</ul>
</div>
</div>
</nav>
</header>
<!-- End header -->
<!-- Start All Pages -->
<div class="all-page-title page-breadcrumb">
<div class="container text-center">
<div class="row">
<div class="col-lg-12">
<h1>Recherche</h1>
<br><br>
</div>
</div>
</div>
</div>
<!-- End All Pages -->
<div class="blog-box">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="heading-title text-center">
<br><br>
<p> </p>
<head>
<style>
#map {
height: 500px ;
width: 1000px;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #323232;
display: block;
margin-left: auto;
margin-right: auto;
padding: 100px
}
#panel {
position: absolute;
top: 5%;
left: 50%;
background: white;
transform: translateX(-50%) translateY(-50%);
padding: 4px;
}
</style>
</head>
<body>
<div id="map" class="map"></div>
<div id="panel" class="leaflet-bar" >
Parc National de Toubkal
<select name="relation" id="relationSelect">
<option value="within">Within<options>
<option value="contains">Contains<options>
<option value="intersects">Intersects<options>
<option value="overlaps">Overlaps<options>
</select>
<select name="geometry" id="geometrySelect">
<option value="point">Djbel Toubkal<options>
<option value="line">Route N°2030<options>
<option value="polygon">Ifni<options>
</select>
<button id="executeQuery">Run Query</button>
</div>
<script>
const map = L.map("map", {minZoom: 5}).setView([31.061762211372717, -7.914919899573209], 11);
const apiKey = "AAPK22b2239330f348e6856b49ba92d3aa36l-qSfkzwWqJOSvuCHty6k4cDtOREFtSJoPiRlta-1uwftZL9sBYHbKzcDXjD4ZK5";
const basemapLayers = {Streets: L.esri.Vector.vectorBasemapLayer("ArcGIS:Topographic", { apiKey: apiKey }).addTo(map)
};
var Maroc = L.esri
.featureLayer({
url: "https://services6.arcgis.com/f4ktY2fh4AlEsjcx/arcgis/rest/services/maroc/FeatureServer/0",
style: {
color: "#000000",
weight: 5
}});
var Toubkal = L.esri
.featureLayer({
url: "https://services6.arcgis.com/f4ktY2fh4AlEsjcx/arcgis/rest/services/toubkal/FeatureServer/0",
style: {
color: "#000000",
weight: 5
}});
Toubkal.addTo(map);
const icon = L.icon({
iconUrl: "https://mrbourriz.github.io/Sommet.png/mountain.png",
iconSize: [27, 31],
iconAnchor: [13.5, 17.5],
popupAnchor: [0, -11]
});
const Sommet = L.marker([31.060090584371125, -7.914748488270757 ], {icon: icon}).addTo(map);
const Route = L.polyline([ // Create a line to query against
[31.138,-7.917],
[31.132,-7.921],
[31.124,-7.920],
[31.123,-7.920],
[31.117,-7.920],
[31.116,-7.920],
[31.111,-7.919],
[31.107,-7.916]
], {
color: 'red',
weight: 3
}).addTo(map);
const Ifni = L.polygon([ // Create a polygon to query against
[31.028, -7.888],
[31.029, -7.888],
[31.032, -7.888],
[31.032, -7.887],
[31.033, -7.885],
[31.033, -7.880],
[31.033, -7.879],
[31.031, -7.880],
[31.030, -7.881],
[31.029, -7.883],
[31.029, -7.884],
[31.028, -7.888],
[31.028, -7.888]
], {
color: 'blue',
weight: 5
}).addTo(map);
const geometries = {
line: Route,
point: Sommet,
polygon: Ifni
};
const relationship = document.getElementById('relationSelect');
const geometry = document.getElementById('geometrySelect');
const runQueryButton = document.getElementById('executeQuery');
let previousIds = [];
function reset () { // Reset all features back to their regularly defined styles
for (let i = previousIds.length - 1; i >= 0; i--) {
Toubkal.resetStyle(previousIds[i]);
}
}
function query () {
reset();
const inputGeometry = geometries[geometry.value];
Toubkal.query()[relationship.value](inputGeometry).ids(function (error, ids) {
if (error) {
console.log('Error with query: ' + error);
} else if (ids) {
previousIds = ids;
for (let i = ids.length - 1; i >= 0; i--) {
Toubkal.setFeatureStyle(ids[i], { color: 'green', weight: 4 });
}
}
});
}
runQueryButton.addEventListener('click', query);
Toubkal.once('load', function () {
query();
});
</script>
<a href="#" id="back-to-top" title="Back to top" style="display: none;">↑</a>
<!-- ALL JS FILES -->
<script src="Js/jquery-3.2.1.min.js"></script>
<script src="Js/popper.min.js"></script>
<script src="Js/bootstrap.min.js"></script>
<!-- ALL PLUGINS -->
<script src="Js/jquery.superslides.min.js"></script>
<script src="Js/images-loded.min.js"></script>
<script src="Js/isotope.min.js"></script>
<script src="Js/form-validator.min.js"></script>
<script src="Js/contact-form-script.js"></script>
<script src="Js/custom.js"></script>
</body>
</html>