-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
281 lines (244 loc) · 12.2 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
278
279
280
281
<!DOCTYPE html>
<html itemscope itemtype="http://schema.org/Product" lang="en">
<head>
<!-- Basic Page Needs
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta charset="utf-8">
<title>xServer.js</title>
<meta name="description" content="JavaScript Samples for PTV xServer">
<meta name="author" content="PTV Group">
<!-- Schema.org markup for Google+ -->
<meta itemprop="name" content="xServer.js">
<meta itemprop="description" content="JavaScript Samples for PTV xServer">
<meta itemprop="image" content="./images/thumbnail.png">
<!-- Open Graph data -->
<meta property="og:title" content="xServer.js" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://ptv-logistics.github.io/xserverjs/" />
<meta property="og:image" content="./images/thumbnail.png" />
<meta property="og:description" content="JavaScript Samples for PTV xServer" />
<!-- Mobile Specific Metas
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
<!-- FONT
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
<!-- CSS
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w"
crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/grids-responsive-min.css">
<link rel="stylesheet" href="css/index.css">
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.js"></script>
<![endif]-->
<link rel="stylesheet" href="css/ajaxtabs.css">
<!-- Favicon
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="icon" type="image/x-icon" href="images/favicon.ico">
<style>
.leaflet-container {
background: #222;
}
</style>
</head>
<body>
<!-- <iframe height="300" width="100%" src="bg.html" allowfullscreen frameborder="0"></iframe> -->
<!-- Primary Page Layout
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<div class="header">
<div class="home-menu pure-menu pure-menu-horizontal pure-menu-fixed">
<!-- <a class="pure-menu-heading" href="">xserver.js</a> -->
<ul class="pure-menu-list">
<li class="pure-menu-item"><a href="#" class="pure-menu-link">Home</a></li>
<li class="pure-menu-item"><a href="#boilerplate" class="pure-menu-link">Widgets</a></li>
<li class="pure-menu-item"><a href="#leaflet-xserver" class="pure-menu-link">leaflet-xserver</a></li>
<li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover"><a href="#premium-samples" class="pure-menu-link">Samples</a>
<ul class="pure-menu-children">
<li class="pure-menu-item"><a href="#routing-machine" class="pure-menu-link">Routing Machine</a></li>
<li class="pure-menu-item"><a href="#poi-locator" class="pure-menu-link">POI Locator</a></li>
<li class="pure-menu-item"><a href="#admin-regions" class="pure-menu-link">Admin Regions</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="splash-container" id="map">
<div class="splash" style="z-index:10000">
<div class="pure-g">
<div class="l-box pure-u-1 pure-u-sm-1-2">
<h1 class="splash-head">xserver.js</h1>
<p class="splash-subhead">
JavaScript Samples for PTV xServer
</p>
<a class="pure-button pure-button-primary" href="https://github.com/ptv-logistics/xserverjs">Fork me on
GitHub</a>
</div>
<div class="l-box pure-u-1 pure-u-sm-1-2">
<img class="pure-img-responsive" src="images/PTV_Group_Vision_EN_4C.png">
</div>
</div>
</div>
</div>
<div class="content-wrapper">
<div id="boilerplate" class="content">
<h2 class="content-head is-center">Use PTV xServer with your favourite map widgets</h2>
<p class="content">The xMapServer tile api lets you add an xServer map to virtually every existing map widget.
Templates for the most
common widgets show how to initialize them for optimal performance on both cloud and on-premise.
<a href="https://github.com/ptv-logistics/xserverjs/blob/master/boilerplate/">Read here for more.</a>
</p>
<div class="pure-g">
<div class="l-box pure-u-1 pure-u-md-1-2">
<h3 class="content-subhead is-center">Leaflet</h3>
<iframe height="300" width="100%" src="./boilerplate/Leaflet.1.0.html" allowfullscreen frameborder="0"></iframe>
</div>
<div class="l-box pure-u-1 pure-u-md-1-2">
<h3 class="content-subhead is-center">OpenLayers</h3>
<iframe height="300" width="100%" src="./boilerplate/OpenLayers3.html" allowfullscreen frameborder="0"></iframe>
</div>
<div class="l-box pure-u-1 pure-u-md-1-2">
<h3 class="content-subhead is-center">MapLibre GL</h3>
<iframe height="300" width="100%" src="./boilerplate/MapLibre-heatmap.html" allowfullscreen frameborder="0"></iframe>
</div>
<div class="l-box pure-u-1 pure-u-md-1-2">
<h3 class="content-subhead is-center">Cesium</h3>
<iframe height="300" width="100%" src="./boilerplate/cesium.html" allowfullscreen frameborder="0"></iframe>
</div>
</div>
</div>
<div id="leaflet-xserver" class="content">
<h2 class="content-head is-center">leaflet-xserver</h2>
<p class="content">leaflet-xserver is an extension for Leaflet to display extended Map content. Specific layer
classes let you add styleable
and clickable Feature-Layers. leaflet-xserver is available as <a href="https://www.npmjs.com/package/leaflet-xserver">npm
package</a>
and via <a href="https://unpkg.com/leaflet-xserver/">unpkg cdn</a>.
</p>
<div class="l-box">
<iframe height="450" width="100%" src="./boilerplate/Leaflet-Clickable.1.0.html" allowfullscreen
frameborder="0"></iframe>
</div>
</div>
<div id="premium-samples" class="content">
<h2 class="content-head is-center">Premium code samples</h2>
<p class="content">Take one of our pre-fabricated reference implementations to jump-start your application.
</p>
<h3 id="routing-machine" class="content-head is-center">Leaflet-Routing-Machine</h3>
<p class="content">Build an interactive route planner with xMap-, xRoute- and xLocate-server.
<a href="https://github.com/ptv-logistics/xserverjs/blob/master/premium-samples/lrm-xserver/">Read here for
more.</a>
</p>
<div class="l-box">
<ul id="lrmtabs" class="shadetabs">
<!-- <li><a href="./premium-samples/lrm-xserver/xserver-1/index.html" rel="#iframe">xServer-1</a></li> -->
<li><a href="https://ptv-logistics.github.io/fl-labs/index.html" class="selected" rel="#iframe">xServer-1</a></li>
<li><a href="./premium-samples/lrm-xserver/xserver-2/index.html" rel="#iframe">xServer-2</a></li>
<!-- li><a href="https://ptv-logistics.github.io/xmas-server/index.html" class="selected" rel="#iframe">xMas-Server</a></li -->
</ul>
<div id="lrmdivcontainer" style="height:500px"></div>
</div>
<h3 id="poi-locator" class="content-head is-center">POI Locator</h3>
<p class="content">Display and search your locations with PTV xServer.
<a href="https://github.com/ptv-logistics/xserverjs/blob/master/premium-samples/poi-locator/">Read here for
more.</a>
</p>
<div class="l-box">
<iframe height="500" width="100%" src="./premium-samples/poi-locator/index.html" allowfullscreen frameborder="0"></iframe>
</div>
<h3 id="admin-regions" class="content-head is-center">Administrative Regions</h3>
<p class="content">Add new data and functions to the map.
<a href="https://github.com/ptv-logistics/xserverjs/blob/master/premium-samples/admin-regions/">Read here for
more.</a>
</p>
<div class="l-box">
<ul id="countrytabs" class="shadetabs">
<li><a href="./premium-samples/admin-regions/index.html" class="selected" rel="#iframe">GeoJSON</a></li>
<li><a href="./premium-samples/admin-regions/admin-regions-merge.html" rel="#iframe">TopoJSON</a></li>
<li><a href="./premium-samples/admin-regions/admin-3d-choropleth.html" rel="#iframe">3D-Choropleth</a></li>
</ul>
<div id="countrydivcontainer" style="border:1px solid gray; width:100%; height:500px; margin-bottom: 3em; padding: 1px"></div>
</div>
</div>
<div class="footer l-box is-center darklink">
Samples powered by <a href="https://xserver.ptvgroup.com/en-uk/products/ptv-xserver-internet/">PTV xServer
internet</a>
</div>
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<script src="./css/ajaxtabs.js"></script>
<script src="./token.js"></script>
<script>
var countries = new ddajaxtabs("countrytabs", "countrydivcontainer")
countries.setpersist(false)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()
var lrm = new ddajaxtabs("lrmtabs", "lrmdivcontainer")
lrm.setpersist(false)
lrm.setselectedClassTarget("link") //"link" or "linkparent"
lrm.init()
var map = L.map('map', {
zoomControl: false,
attributionControl: false
}).setView([50, 8], 3);
L.tileLayer(
'https://s0{s}-xserver2-test.cloud.ptvgroup.com/services/rest/XMap/tile/{z}/{x}/{y}?storedProfile=blackmarble&layers=background,transport&xtok=' +
token, {
subdomains: '1234'
}).addTo(map);
map._handlers.forEach(function (handler) {
handler.disable();
})
var filter = "grayscale(1) blur(3px)";
map.getPanes().tilePane.style.webkitFilter = filter;
map.getPanes().tilePane.style.filter = filter;
var positions = [
[49.01405, 8.4044], // Karlsruhe
[51.50939, -0.11832], // London
[41.883333, 12.483333], // Rome
[48.856667, 2.351667], // Paris
[41.01, 28.960277777778], // Istanbul
[60.170833, 24.9375], // Helsikni
// [55.75, 37.616667], // Moscow
[50.45, 30.5], // Kyiv
[41.383333, 2.183333], // Barcelona
[38.716667, -9.166667], // Lisbon
[40.712778, -74.005833], // NY
[37.7793, -122.4192], // San Francisco
[19.433333, -99.133333], // Mexico City
[25.266666666667, 55.3], // Dubai
[-35.3075, 149.124417], // Canberra
[-33.922667, 18.416689], // Cape Town
[30.033333, 31.233333] // Cairo
];
shuffleArray(positions);
map.setView(positions[0], 18);
var i = 1;
window.setTimeout(function () {
var p = positions[i];
map.flyTo([p[0], p[1]], 18, {
duration: 120
});
map.on('moveend', function (e) {
this.i = ++this.i % positions.length;
p = positions[i];
map.flyTo([p[0], p[1]], 18, {
duration: 120
});
}, this);
}, 4000);
/**
* Randomize array element order in-place.
* Using Durstenfeld shuffle algorithm.
*/
function shuffleArray(array) {
for (var i = array.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = array[i];
array[i] = array[j];
array[j] = temp;
}
}
</script>
</body>
</html>