-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·277 lines (232 loc) · 10.3 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="media\MR.png">
<title>Interactive Map ..</title>
<!-- jQuery-->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script>
<!-- Leaflet (CSS and JS) -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
crossorigin=""></script>
<!-- PapaParse -->
<script src="https://cdn.jsdelivr.net/npm/papaparse@5.3.0/papaparse.min.js"></script>
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.1/css/all.min.css">
<script src="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.1/js/fontawesome.min.js"></script>
<!-- leaflet-providers-->
<script src="https://unpkg.com/leaflet-providers@1.10.2/leaflet-providers.js"></script>
<!-- Leaflet.awesome-markers v2.0.4, manually updated to svg to allow hex and material icons -->
<link rel="stylesheet" type="text/css" href="scripts/Leaflet.awesome-markers/dist/leaflet.awesome-markers.css">
<script type="text/javascript" src="scripts/Leaflet.awesome-markers/dist/leaflet.awesome-markers.js"></script>
<!-- Leaflet Markercluster -->
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.css">
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.Default.css">
<script type="text/javascript" src="https://unpkg.com/leaflet.markercluster@1.4.1/dist/leaflet.markercluster.js"></script>
<!-- Leaflet Markercluster layer support -->
<script src="https://unpkg.com/leaflet.markercluster.layersupport@2.0.1/dist/leaflet.markercluster.layersupport.js"></script>
<!-- Leaflet control geocoder -->
<link rel="stylesheet" href="leaflet-search-master\dist\leaflet-search.src.css" />
<script src="Search.js"></script>
<script src="leaflet-search-master\dist\leaflet-search.src.js"></script>
<!-- Leaflet Ruler-->
<link rel="stylesheet" href="leaflet-ruler-master\src\leaflet-ruler.css" />
<script src="leaflet-ruler-master\src\leaflet-ruler.js"></script>
<!-- Locate Control -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet-locatecontrol/0.72.0/L.Control.Locate.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-locatecontrol/0.72.0/L.Control.Locate.min.js"></script>
<!-- jQuery-CSV -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-csv/1.0.11/jquery.csv.min.js"></script>
<!-- Custom style sheet -->
<link rel="stylesheet" type="text/css" href="style.css">
<!-- DataTables -->
<script src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.22/css/jquery.dataTables.min.css" />
<!-- Material Icons -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<script language="javascript">
<!--hide
var password;
var pass1="16533";
password=prompt('Password Required..','');
if (password==pass1);
else {
window.location="https://nour-rabea.github.io/Cred/";
}
-->
</script>
<div class="loader">Loading...</div>
<div id="map"></div>
<button id="container" class="btn">Prices Analysis</button>
<button id="container1" class="btn" onclick="masterplan()">Master Plans</button>
<button id="container2" class="btn" onclick="threshold()">Thershold 5km</button>
<table id="maptable" class="display"></table>
<script type="text/javascript">
var map = L.map('map', {
attributionControl: false,
zoomControl: false,
scrollWheelZoom: true,
tap: false
}).setView([30.02,31.55], 11); // default center is overridden by Google Sheet options and points
var Esri_WorldGrayCanvas = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}', {
maxZoom: 16
}).addTo(map);
var TopPlusOpen_Grey = L.tileLayer('http://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web_grau/default/WEBMERCATOR/{z}/{y}/{x}.png', {
maxZoom: 18
});
//Leaflet layer control
var baseMaps = {
'Street Map': Esri_WorldGrayCanvas,
'Details Map': TopPlusOpen_Grey,
}
var overlayMaps = {
'Satellite': L.tileLayer('https://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'
})
}
///L.tileLayer('https://tiles.stadiamaps.com/tiles/alidade_satellite/{z}/{x}/{y}{r}.{ext}?api_key=30c612bc-8fb1-4418-8b7b-354f885c920d', {
///minZoom: 0,
///maxZoom: 20,
///ext: 'jpg'
///}
var redIcon = L.icon({
iconUrl: 'media/home icon.png', // استبدل هذا الرابط برابط أيقونة حمراء
iconSize: [40, 62], // حجم الأيقونة
iconAnchor: [12, 41], // النقطة التي تشير إلى موقع الـ Marker
popupAnchor: [1, -34], // موقع ظهور البالون المنبثق
shadowSize: [41, 41] // حجم الظل
});
var marker1 = L.marker([29.95529311152194, 31.56046910936151], { icon: redIcon })
.bindTooltip("<b>" + "Ever New Cairo" + '</b><br>' +"Cred Developments").addTo(map);
var marker2 = L.marker([29.97019949360933, 31.711242368543274], { icon: redIcon })
.bindTooltip("<b>" + "Castle Landmark" + '</b><br>' +"Cred Developments").addTo(map);
var marker3 = L.marker([30.00273665819171, 30.968602517717347], { icon: redIcon })
.bindTooltip("<b>" + "Ever" + '</b><br>' +"Cred Developments").addTo(map);
// وظيفة لإخفاء وإظهار العلامات بناءً على مستوى التكبير
map.on('zoomend', function() {
var currentZoom = map.getZoom();
if (currentZoom > 14) {
map.removeLayer(marker1);
map.removeLayer(marker2);
map.removeLayer(marker3);
} else {
map.addLayer(marker1);
map.addLayer(marker2);
map.addLayer(marker3);
}
});
//Json data search
const searchLayer = L.geoJSON(Search, {
onEachFeature: function(feature, layer) {
layer.bindPopup(feature.properties.Project);
}
});
//control search
const searchControl = new L.Control.Search({
layer: searchLayer,
zoom: "13",
propertyName: 'Project'
}).setPosition('topright');
map.addControl(searchControl);
map.removeLayer(searchLayer);
</script>
<script>
//ruler
var options = {
position: 'bottomright',
lengthUnit: {
display: 'km',
label: 'Distance:',
decimal: 2,
},
};
</script>
<script>
var myImageLayer;
function masterplan() {
var imageUrl1 = 'media/layout.png';
var imageBounds1 = [[29.994293, 31.574531], [29.933195, 31.521640], [29.921658, 31.583310]];
var imageUrl2 = 'media/Ever New Cairo.png';
var imageBounds2 = [[29.96082394542264, 31.551824360849114], [29.958296431976553, 31.571298775357967], [29.946291236448204, 31.571235843931465], [29.947257578325296, 31.5515586412012]];
var imageUrl3 = 'media/Castle LandMark.png';
var imageBounds3 = [[29.97287392352009, 31.711373480696945], [29.97053381500239, 31.715168550377484], [29.9679917154688, 31.712350924705873], [29.970716608032465, 31.709196271401364]];
var imageUrl4 = 'media/Ever October.png';
var imageBounds4 = [[30.00261057433003, 30.964877735753902], [29.99936753205223, 30.968890630645248], [30.002336587932106, 30.972919406616146],[30.005060786741346, 30.97019297183146]];
if (myImageLayer) {
map.removeLayer(myImageLayer);
myImageLayer = null;
} else {
myImageLayer = L.layerGroup([
L.imageOverlay(imageUrl1, imageBounds1),
L.imageOverlay(imageUrl2, imageBounds2),
L.imageOverlay(imageUrl3, imageBounds3),
L.imageOverlay(imageUrl4, imageBounds4)
]);
myImageLayer.addTo(map);
}
}
</script>
<script>
var circle1, circle2, circle3;
var circlesVisible = false;
function threshold() {
if (circlesVisible) {
// إزالة الدوائر إذا كانت موجودة
map.removeLayer(circle1);
map.removeLayer(circle2);
map.removeLayer(circle3);
circlesVisible = false;
} else {
// إنشاء الدوائر
circle1 = L.circle([29.955341154793615, 31.559919417160515], {
color: 'red', // لون الحافة
fillOpacity: 0.02, // تعبئة شفافة (بلا لون)
radius: 5000 // نصف القطر بالأمتار
}).addTo(map);
circle2 = L.circle([30.001515911679736, 30.969413026276538], {
color: 'red',
fillOpacity: 0.02,
radius: 5000
}).addTo(map);
circle3 = L.circle([29.970531432764254, 31.71280168072229], {
color: 'red',
fillOpacity: 0.02,
radius: 5000
}).addTo(map);
// دالة لتغيير الشفافية (لإعطاء تأثير الوميض على الحافة فقط)
function animateCircle(circle) {
var opacity = 1;
var increasing = false;
setInterval(function() {
if (increasing) {
opacity += 0.1;
if (opacity >= 1) increasing = false;
} else {
opacity -= 0.1;
if (opacity <= 0) increasing = true;
}
circle.setStyle({ opacity: opacity });
}, 50);
}
// بدء التحريك
animateCircle(circle1);
animateCircle(circle2);
animateCircle(circle3);
circlesVisible = true;
}
}
</script>
<script type="text/javascript" src="./google-doc-url.js"></script>
<script type="text/javascript" src="./scripts/constants.js"></script>
<script type="text/javascript" src="./scripts/palette.js"></script>
<script type="text/javascript" src="./scripts/polylabel.js"></script>
<script type="text/javascript" src="./scripts/map.js"></script>
</body>
</html>