Skip to content

Commit 3c59ed5

Browse files
author
Ed Linklater
committed
Update JS dependencies, set default height (fixes #2)
1 parent 8552302 commit 3c59ed5

10 files changed

+20815
-20609
lines changed

client/leaflet-providers.js

+97-48
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
if (attr.indexOf('{attribution.') === -1) {
5757
return attr;
5858
}
59-
return attr.replace(/\{attribution.(\w*)\}/,
59+
return attr.replace(/\{attribution.(\w*)\}/g,
6060
function (match, attributionName) {
6161
return attributionReplacer(providers[attributionName].options.attribution);
6262
}
@@ -81,16 +81,10 @@
8181
options: {
8282
maxZoom: 19,
8383
attribution:
84-
'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
84+
'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
8585
},
8686
variants: {
8787
Mapnik: {},
88-
BlackAndWhite: {
89-
url: 'http://{s}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png',
90-
options: {
91-
maxZoom: 18
92-
}
93-
},
9488
DE: {
9589
url: 'https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png',
9690
options: {
@@ -114,7 +108,10 @@
114108
HOT: {
115109
url: 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
116110
options: {
117-
attribution: '{attribution.OpenStreetMap}, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>'
111+
attribution:
112+
'{attribution.OpenStreetMap}, ' +
113+
'Tiles style by <a href="https://www.hotosm.org/" target="_blank">Humanitarian OpenStreetMap Team</a> ' +
114+
'hosted by <a href="https://openstreetmap.fr/" target="_blank">OpenStreetMap France</a>'
118115
}
119116
},
120117
BZH: {
@@ -126,20 +123,6 @@
126123
}
127124
}
128125
},
129-
OpenInfraMap: {
130-
url: 'https://tiles-{s}.openinframap.org/{variant}/{z}/{x}/{y}.png',
131-
options: {
132-
maxZoom: 18,
133-
attribution:
134-
'{attribution.OpenStreetMap}, <a href="http://www.openinframap.org/about.html">About OpenInfraMap</a>'
135-
},
136-
variants: {
137-
Power: 'power',
138-
Telecom: 'telecoms',
139-
Petroleum: 'petroleum',
140-
Water: 'water'
141-
}
142-
},
143126
OpenSeaMap: {
144127
url: 'https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png',
145128
options: {
@@ -209,28 +192,57 @@
209192
},
210193
Landscape: 'landscape',
211194
Outdoors: 'outdoors',
212-
Pioneer: 'pioneer'
195+
Pioneer: 'pioneer',
196+
MobileAtlas: 'mobile-atlas',
197+
Neighbourhood: 'neighbourhood'
213198
}
214199
},
215200
OpenMapSurfer: {
216-
url: 'https://korona.geog.uni-heidelberg.de/tiles/{variant}/x={x}&y={y}&z={z}',
201+
url: 'https://maps.heigit.org/openmapsurfer/tiles/{variant}/webmercator/{z}/{x}/{y}.png',
217202
options: {
218-
maxZoom: 20,
203+
maxZoom: 19,
219204
variant: 'roads',
220-
attribution: 'Imagery from <a href="http://giscience.uni-hd.de/">GIScience Research Group @ University of Heidelberg</a> &mdash; Map data {attribution.OpenStreetMap}'
205+
attribution: 'Imagery from <a href="http://giscience.uni-hd.de/">GIScience Research Group @ University of Heidelberg</a> | Map data '
221206
},
222207
variants: {
223-
Roads: 'roads',
208+
Roads: {
209+
options: {
210+
variant: 'roads',
211+
attribution: '{attribution.OpenMapSurfer}{attribution.OpenStreetMap}'
212+
}
213+
},
214+
Hybrid: {
215+
options: {
216+
variant: 'hybrid',
217+
attribution: '{attribution.OpenMapSurfer}{attribution.OpenStreetMap}'
218+
}
219+
},
224220
AdminBounds: {
225221
options: {
226222
variant: 'adminb',
227-
maxZoom: 19
223+
maxZoom: 18,
224+
attribution: '{attribution.OpenMapSurfer}{attribution.OpenStreetMap}'
225+
}
226+
},
227+
ContourLines: {
228+
options: {
229+
variant: 'asterc',
230+
maxZoom: 18,
231+
minZoom: 13,
232+
attribution: '{attribution.OpenMapSurfer} <a href="https://lpdaac.usgs.gov/products/aster_policies">ASTER GDEM</a>'
228233
}
229234
},
230-
Grayscale: {
235+
Hillshade: {
231236
options: {
232-
variant: 'roadsg',
233-
maxZoom: 19
237+
variant: 'asterh',
238+
maxZoom: 18,
239+
attribution: '{attribution.OpenMapSurfer} <a href="https://lpdaac.usgs.gov/products/aster_policies">ASTER GDEM</a>, <a href="http://srtm.csi.cgiar.org/">SRTM</a>'
240+
}
241+
},
242+
ElementsAtRisk: {
243+
options: {
244+
variant: 'elements_at_risk',
245+
attribution: '{attribution.OpenMapSurfer}{attribution.OpenStreetMap}'
234246
}
235247
}
236248
}
@@ -252,10 +264,11 @@
252264
url: 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}{r}.png?access_token={accessToken}',
253265
options: {
254266
attribution:
255-
'Imagery from <a href="http://mapbox.com/about/maps/">MapBox</a> &mdash; ' +
256-
'Map data {attribution.OpenStreetMap}',
267+
'<a href="https://www.mapbox.com/about/maps/" target="_blank">&copy; Mapbox</a> ' +
268+
'{attribution.OpenStreetMap} ' +
269+
'<a href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map</a>',
257270
subdomains: 'abcd',
258-
id: 'streets',
271+
id: 'mapbox.streets',
259272
accessToken: '<insert your access token here>',
260273
}
261274
},
@@ -283,6 +296,7 @@
283296
url: 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}',
284297
options: {
285298
variant: 'watercolor',
299+
ext: 'jpg',
286300
minZoom: 1,
287301
maxZoom: 16
288302
}
@@ -301,6 +315,13 @@
301315
maxZoom: 18
302316
}
303317
},
318+
TerrainLabels: {
319+
options: {
320+
variant: 'terrain-labels',
321+
minZoom: 0,
322+
maxZoom: 18
323+
}
324+
},
304325
TopOSMRelief: {
305326
url: 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}',
306327
options: {
@@ -318,6 +339,24 @@
318339
}
319340
}
320341
},
342+
TomTom: {
343+
url: 'https://{s}.api.tomtom.com/map/1/tile/{variant}/{style}/{z}/{x}/{y}.{ext}?key={apikey}',
344+
options: {
345+
variant: 'basic',
346+
maxZoom: 22,
347+
attribution:
348+
'<a href="https://tomtom.com" target="_blank">&copy; 1992 - ' + new Date().getFullYear() + ' TomTom.</a> ',
349+
subdomains: 'abcd',
350+
style: 'main',
351+
ext: 'png',
352+
apikey: '<insert your API key here>',
353+
},
354+
variants: {
355+
Basic: 'basic',
356+
Hybrid: 'hybrid',
357+
Labels: 'labels'
358+
}
359+
},
321360
Esri: {
322361
url: 'https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
323362
options: {
@@ -428,19 +467,15 @@
428467
/*
429468
* HERE maps, formerly Nokia maps.
430469
* These basemaps are free, but you need an API key. Please sign up at
431-
* http://developer.here.com/getting-started
432-
*
433-
* Note that the base urls contain '.cit' whichs is HERE's
434-
* 'Customer Integration Testing' environment. Please remove for production
435-
* envirionments.
470+
* https://developer.here.com/plans
436471
*/
437472
url:
438-
'https://{s}.{base}.maps.cit.api.here.com/maptile/2.1/' +
473+
'https://{s}.{base}.maps.api.here.com/maptile/2.1/' +
439474
'{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?' +
440475
'app_id={app_id}&app_code={app_code}&lg={language}',
441476
options: {
442477
attribution:
443-
'Map &copy; 1987-2014 <a href="http://developer.here.com">HERE</a>',
478+
'Map &copy; 1987-' + new Date().getFullYear() + ' <a href="http://developer.here.com">HERE</a>',
444479
subdomains: '1234',
445480
mapID: 'newest',
446481
'app_id': '<insert your app_id here>',
@@ -461,14 +496,21 @@
461496
normalDayGreyMobile: 'normal.day.grey.mobile',
462497
normalDayTransit: 'normal.day.transit',
463498
normalDayTransitMobile: 'normal.day.transit.mobile',
499+
normalDayTraffic: {
500+
options: {
501+
variant: 'normal.traffic.day',
502+
base: 'traffic',
503+
type: 'traffictile'
504+
}
505+
},
464506
normalNight: 'normal.night',
465507
normalNightMobile: 'normal.night.mobile',
466508
normalNightGrey: 'normal.night.grey',
467509
normalNightGreyMobile: 'normal.night.grey.mobile',
468510
normalNightTransit: 'normal.night.transit',
469511
normalNightTransitMobile: 'normal.night.transit.mobile',
470-
redcuedDay: 'reduced.day',
471-
redcuedNight: 'reduced.night',
512+
reducedDay: 'reduced.day',
513+
reducedNight: 'reduced.night',
472514
basicMap: {
473515
options: {
474516
type: 'basetile'
@@ -511,6 +553,13 @@
511553
variant: 'hybrid.grey.day'
512554
}
513555
},
556+
hybridDayTraffic: {
557+
options: {
558+
variant: 'hybrid.traffic.day',
559+
base: 'traffic',
560+
type: 'traffictile'
561+
}
562+
},
514563
pedestrianDay: 'pedestrian.day',
515564
pedestrianNight: 'pedestrian.night',
516565
satelliteDay: {
@@ -552,9 +601,9 @@
552601
}
553602
},
554603
CartoDB: {
555-
url: 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.png',
604+
url: 'https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png',
556605
options: {
557-
attribution: '{attribution.OpenStreetMap} &copy; <a href="http://cartodb.com/attributions">CartoDB</a>',
606+
attribution: '{attribution.OpenStreetMap} &copy; <a href="https://carto.com/attributions">CARTO</a>',
558607
subdomains: 'abcd',
559608
maxZoom: 19,
560609
variant: 'light_all'
@@ -573,7 +622,7 @@
573622
}
574623
},
575624
HikeBike: {
576-
url: 'http://{s}.tiles.wmflabs.org/{variant}/{z}/{x}/{y}.png',
625+
url: 'https://tiles.wmflabs.org/{variant}/{z}/{x}/{y}.png',
577626
options: {
578627
maxZoom: 19,
579628
attribution: '{attribution.OpenStreetMap}',
@@ -786,7 +835,7 @@
786835
minZoom: 11,
787836
maxZoom: 18,
788837
bounds: [[1.56073, 104.11475], [1.16, 103.502]],
789-
attribution: 'New OneMap | Map data &copy; contributors, <a href="http://SLA.gov.sg">Singapore Land Authority</a>'
838+
attribution: '<img src="https://docs.onemap.sg/maps/images/oneMap64-01.png" style="height:20px;width:20px;"/> New OneMap | Map data &copy; contributors, <a href="http://SLA.gov.sg">Singapore Land Authority</a>'
790839
},
791840
variants: {
792841
Default: 'Default',

0 commit comments

Comments
 (0)