-
Notifications
You must be signed in to change notification settings - Fork 1
/
Recherche.html
259 lines (222 loc) · 9.4 KB
/
Recherche.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
<!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/palmicon.png" >
<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" href="Image/georeserve.png" type="image/x-icon">
<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
}
</style>
</head>
<body>
<div id="map" class="map"></div>
<script>
const map = L.map("map", {minZoom: 2}).setView([29.638933, -9.665423], 5);
const apiKey = "AAPK22b2239330f348e6856b49ba92d3aa36l-qSfkzwWqJOSvuCHty6k4cDtOREFtSJoPiRlta-1uwftZL9sBYHbKzcDXjD4ZK5";
const basemapLayers = {Streets: L.esri.Vector.vectorBasemapLayer("ArcGIS:Streets", { apiKey: apiKey }).addTo(map),
Topographic: L.esri.Vector.vectorBasemapLayer("ArcGIS:Topographic", { apiKey: apiKey }),
Imagery: L.esri.Vector.vectorBasemapLayer("ArcGIS:Imagery", { apiKey: apiKey })
};
var Maroc = L.esri
.featureLayer({
url: "https://services6.arcgis.com/f4ktY2fh4AlEsjcx/arcgis/rest/services/maroc/FeatureServer/0",
style: {
color: "#000000",
weight: 5
}});
Maroc.addTo(map);
// Creation du selecteur SQL
L.control.layers(basemapLayers, null, { collapsed: false }).addTo(map);
//Ajout d'un controleur
L.Control.QueryControl = L.Control.extend({
onAdd: function (map) {
const whereClauses = [
"Cherchez...",
"Superficie > 1000",
"Superficie < 1000",
"Note > 4.4",
"Note < 4.4",
"Creation > 2000",
"Creation < 2000"
];
//Creation de select
const select = L.DomUtil.create("select", "");
select.setAttribute("id", "whereClauseSelect");
select.setAttribute("style", "font-size: 16px;padding:4px 8px;");
whereClauses.forEach(function (whereClause) {
let option = L.DomUtil.create("option");
option.innerHTML = whereClause;
select.appendChild(option);
});
return select;
},
onRemove: function (map) {
// Nothing to do here
}
});
L.control.queryControl = function (opts) {
return new L.Control.QueryControl(opts);
};
L.control
.queryControl({
position: "topright"
})
.addTo(map);
//Ajout des Features
const parc = L.esri
.featureLayer({
url: "https://services6.arcgis.com/f4ktY2fh4AlEsjcx/arcgis/rest/services/parc/FeatureServer/0",
simplifyFactor: 0.5,
precision: 4,
style: {
color: "#FF0000",
weight: 3
},
//Apparition des features juste lors de la requete
where: "1 = 0"
})
.addTo(map);
//Execution de la requete
const select = document.getElementById("whereClauseSelect");
select.addEventListener("change", () => {
if (select.value !== "") {
parc.setWhere(select.value);
}
});
//Pop up
parc.bindPopup(function (layer) {
return L.Util.template("<b>Nom {Nom}</b> <br>"+ "Creation: {Creation} <br>" + "Superficie: {Superficie} km² <br> "+"Note: {Note}/5", layer.feature.properties);
});
</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>