-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
221 lines (168 loc) · 9.73 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
<!DOCTYPE html>
<html>
<head>
<style>
.logo_img{
position: fixed;
left: 2px;
top: 2px;
z-index: 99999999999999999;
}
.responsive {
max-width: 100%;
height: auto;
}
</style>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script>
L_NO_TOUCH = false;
L_DISABLE_3D = false;
</script>
<style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>
<style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js"></script>
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"/>
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>
<meta name="viewport" content="width=device-width,
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
#map_987ab9758c708703978419c398416244 {
position: relative;
width: 100.0%;
height: 100.0%;
left: 0.0%;
top: 0.0%;
}
.leaflet-container { font-size: 1rem; }
</style>
<style>
.foliumpopup {
margin: auto;
}
.foliumpopup table{
margin: auto;
}
.foliumpopup tr{
text-align: left;
}
.foliumpopup th{
padding: 2px; padding-right: 8px;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet-search.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet-search.min.css"/>
</head>
<body>
<div class="folium-map" id="map_987ab9758c708703978419c398416244" > <a href="https://kauevestena.github.io/opensidewalkmap/about.html">
<img
src="assets/page_logo.png"
alt="OSWM Project"
title="Click for more information on OSWM project!!"
class="logo_img responsive"
></img>
</a>
</div>
</body>
<script>
var map_987ab9758c708703978419c398416244 = L.map(
"map_987ab9758c708703978419c398416244",
{
center: [0.0, 0.0],
crs: L.CRS.EPSG3857,
zoom: 1,
zoomControl: false,
preferCanvas: false,
}
);
L.control.scale().addTo(map_987ab9758c708703978419c398416244);
var tile_layer_75d29784d7213f2041da2b6af6b60e81 = L.tileLayer(
"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",
{"attribution": "\u0026copy; \u003ca href=\"https://www.openstreetmap.org/copyright\"\u003eOpenStreetMap\u003c/a\u003e contributors \u0026copy; \u003ca href=\"https://carto.com/attributions\"\u003eCARTO\u003c/a\u003e", "detectRetina": false, "maxNativeZoom": 20, "maxZoom": 10, "minZoom": 2, "noWrap": false, "opacity": 0.5, "subdomains": "abcd", "tms": false}
);
tile_layer_75d29784d7213f2041da2b6af6b60e81.addTo(map_987ab9758c708703978419c398416244);
function geo_json_76972e76e227c4d8d4d4b37e7474b5d3_highlighter(feature) {
switch(feature.id) {
default:
return {"weight": 12};
}
}
function geo_json_76972e76e227c4d8d4d4b37e7474b5d3_pointToLayer(feature, latlng) {
var opts = {"bubblingMouseEvents": true, "color": "#800080", "dashArray": null, "dashOffset": null, "fill": true, "fillColor": "magenta", "fillOpacity": 1, "fillRule": "evenodd", "lineCap": "round", "lineJoin": "round", "opacity": 1.0, "radius": 7, "stroke": true, "weight": 3};
return new L.CircleMarker(latlng, opts)
}
function geo_json_76972e76e227c4d8d4d4b37e7474b5d3_onEachFeature(feature, layer) {
layer.on({
mouseout: function(e) {
if(typeof e.target.setStyle === "function"){
geo_json_76972e76e227c4d8d4d4b37e7474b5d3.resetStyle(e.target);
}
},
mouseover: function(e) {
if(typeof e.target.setStyle === "function"){
const highlightStyle = geo_json_76972e76e227c4d8d4d4b37e7474b5d3_highlighter(e.target.feature)
e.target.setStyle(highlightStyle);
}
},
});
};
var geo_json_76972e76e227c4d8d4d4b37e7474b5d3 = L.geoJson(null, {
onEachFeature: geo_json_76972e76e227c4d8d4d4b37e7474b5d3_onEachFeature,
pointToLayer: geo_json_76972e76e227c4d8d4d4b37e7474b5d3_pointToLayer,
});
function geo_json_76972e76e227c4d8d4d4b37e7474b5d3_add (data) {
geo_json_76972e76e227c4d8d4d4b37e7474b5d3
.addData(data);
}
geo_json_76972e76e227c4d8d4d4b37e7474b5d3_add({"bbox": [-77.041315, -25.4295963, -49.2712724, -12.065698], "features": [{"bbox": [-49.2712724, -25.4295963, -49.2712724, -25.4295963], "geometry": {"coordinates": [-49.2712724, -25.4295963], "type": "Point"}, "id": "0", "properties": {"Place:": "\u003ca href=\"https://kauevestena.github.io/opensidewalkmap_beta/\"\u003eCuritiba\u003c/a\u003e", "center_lat": -25.4295963, "center_long": -49.2712724, "city_name": "Curitiba", "url": "https://kauevestena.github.io/opensidewalkmap_beta/"}, "type": "Feature"}, {"bbox": [-77.041315, -12.065698, -77.041315, -12.065698], "geometry": {"coordinates": [-77.041315, -12.065698], "type": "Point"}, "id": "1", "properties": {"Place:": "\u003ca href=\"https://opensidewalkmap.github.io/lima/\"\u003eLima\u003c/a\u003e", "center_lat": -12.065698, "center_long": -77.041315, "city_name": "Lima", "url": "https://opensidewalkmap.github.io/lima/"}, "type": "Feature"}], "type": "FeatureCollection"});
geo_json_76972e76e227c4d8d4d4b37e7474b5d3.setStyle(function(feature) {return feature.properties.style;});
geo_json_76972e76e227c4d8d4d4b37e7474b5d3.bindPopup(
function(layer){
let div = L.DomUtil.create('div');
let handleObject = feature=>typeof(feature)=='object' ? JSON.stringify(feature) : feature;
let fields = ["Place:"];
let aliases = ["Place:"];
let table = '<table>' +
String(
fields.map(
(v,i)=>
`<tr>
<th>${aliases[i].toLocaleString()}</th>
<td>${handleObject(layer.feature.properties[v]).toLocaleString()}</td>
</tr>`).join(''))
+'</table>';
div.innerHTML=table;
return div
}
,{"className": "foliumpopup"});
geo_json_76972e76e227c4d8d4d4b37e7474b5d3.addTo(map_987ab9758c708703978419c398416244);
var geo_json_76972e76e227c4d8d4d4b37e7474b5d3searchControl = new L.Control.Search({
layer: geo_json_76972e76e227c4d8d4d4b37e7474b5d3,
propertyName: 'city_name',
collapsed: true,
textPlaceholder: 'search available locations',
position:'topright',
initial: false,
hideMarkerOnCollapse: true
});
geo_json_76972e76e227c4d8d4d4b37e7474b5d3searchControl.on('search:locationfound', function(e) {
geo_json_76972e76e227c4d8d4d4b37e7474b5d3.setStyle(function(feature){
return feature.properties.style
})
if(e.layer._popup)
e.layer.openPopup();
})
geo_json_76972e76e227c4d8d4d4b37e7474b5d3searchControl.on('search:collapsed', function(e) {
geo_json_76972e76e227c4d8d4d4b37e7474b5d3.setStyle(function(feature){
return feature.properties.style
});
});
map_987ab9758c708703978419c398416244.addControl( geo_json_76972e76e227c4d8d4d4b37e7474b5d3searchControl );
</script>
</html>