-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
200 lines (165 loc) · 6.07 KB
/
index.html
File metadata and controls
200 lines (165 loc) · 6.07 KB
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
<html lang="en">
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<head>
<title>GNDEC Map</title>
<link rel="stylesheet" type="text/css" href="leaflet-3DMap/leaflet.css"/>
<script type="text/javascript" src="leaflet-3DMap/leaflet.js"></script>
<!--script type="text/javascript" src="leaflet-3DMap/OSMBuildings-Leaflet.js"></script-->
<!-- Load geocoding plugin after Leaflet -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet-geocoder-mapzen/1.9.2/leaflet-geocoder-mapzen.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-geocoder-mapzen/1.9.2/leaflet-geocoder-mapzen.min.js"></script>
<!--link rel="stylesheet" href="https://lab.gdy.club/search/examples/assets/examples.css"-->
<!-- Latest compiled and minified CSS -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<style>
#map{width:100%;height:100%}
</style>
</head>
<body>
<div> <button><a href="https://lab.gdy.club/dist/">
3D buildings with rotation
</a></button>
<button><a href="https://lab.gdy.club/Animation-in-maps/">
Animation
</a></button>
</div>
<div id="map"></div>
<script>
var map = L.map('map').setView([30.8606,75.8617],17);
L.tileLayer('https://lab.gdy.club/osm_tiles/{z}/{x}/{y}.png',{maxZoom:20}).addTo(map);
//new OSMBuildings(map).load();
/*
L.Control.Button = L.Control.extend({
options: {
position: 'bottomleft'
},
initialize: function (options) {
this._button = {};
this.setButton(options);
},
onAdd: function (map) {
this._map = map;
var container = L.DomUtil.create('div', 'leaflet-control-button');
this._container = container;
this._update();
return this._container;
},
onRemove: function (map) {
},
setButton: function (options) {
var button = {
'text': options.text, //string
'iconUrl': options.iconUrl, //string
'onClick': options.onClick, //callback function
'hideText': !!options.hideText, //forced bool
'maxWidth': options.maxWidth || 70, //number
'doToggle': options.toggle, //bool
'toggleStatus': false //bool
};
this._button = button;
this._update();
},
getText: function () {
return this._button.text;
},
getIconUrl: function () {
return this._button.iconUrl;
},
destroy: function () {
this._button = {};
this._update();
},
toggle: function (e) {
if(typeof e === 'boolean'){
this._button.toggleStatus = e;
}
else{
this._button.toggleStatus = !this._button.toggleStatus;
}
this._update();
},
_update: function () {
if (!this._map) {
return;
}
this._container.innerHTML = '';
this._makeButton(this._button);
},
_makeButton: function (button) {
var newButton = L.DomUtil.create('div', 'leaflet-buttons-control-button', this._container);
if(button.toggleStatus)
L.DomUtil.addClass(newButton,'leaflet-buttons-control-toggleon');
var image = L.DomUtil.create('img', 'leaflet-buttons-control-img', newButton);
image.setAttribute('src',button.iconUrl);
if(button.text !== ''){
L.DomUtil.create('br','',newButton); //there must be a better way
var span = L.DomUtil.create('span', 'leaflet-buttons-control-text', newButton);
var text = document.createTextNode(button.text); //is there an L.DomUtil for this?
span.appendChild(text);
if(button.hideText)
L.DomUtil.addClass(span,'leaflet-buttons-control-text-hide');
}
L.DomEvent
.addListener(newButton, 'click', L.DomEvent.stop)
.addListener(newButton, 'click', button.onClick,this)
.addListener(newButton, 'click', this._clicked,this);
L.DomEvent.disableClickPropagation(newButton);
return newButton;
},
_clicked: function () { //'this' refers to button
if(this._button.doToggle){
if(this._button.toggleStatus) { //currently true, remove class
L.DomUtil.removeClass(this._container.childNodes[0],'leaflet-buttons-control-toggleon');
}
else{
L.DomUtil.addClass(this._container.childNodes[0],'leaflet-buttons-control-toggleon');
}
this.toggle();
}
return;
}
});
/*
if (map.getBounds().contains(layer.getLatLng()) &&
layer.zoomLevel <= map.getZoom(4) ) {
https://imgurnoor.gdy.club/dist/
}
/*
var geoJSON = {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"id": 134,
"geometry": {
"type": "Polygon",
"coordinates": [[
[30.8580759, 75.8605802],
[30.8582264, 75.8606044],
[30.8580808, 75.8601923],
[30.8582168, 75.86
"properties": {
"wallColor": "rgb(255,0,0)",
"roofColor": "rgb(255,128,0)",
"height": 500,
"minHeight": 0
}
}]
};
*/
//new OSMBuildings(map).set(geoJSON);
// Add geocoding plugin
var options = {
expanded: true
}
var geocoder1 = L.control.geocoder('search-MKZrG6M', options).addTo(map);
// Increase the z-index on the first geocoder to make results overlap
// the second geocoder input box.
document.querySelectorAll('.leaflet-pelias-control')[0].style.zIndex = 811;
</script>
</body>