Skip to content

Commit 145eb8c

Browse files
ktmudschloerke
authored andcommitted
Upgrade leaftleft-provider to 1.4.0 (#587)
Fixes #567
1 parent fac6c48 commit 145eb8c

File tree

6 files changed

+196
-44
lines changed

6 files changed

+196
-44
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ leaflet 2.0.3
33

44
BUG FIXES and IMPROVEMENTS
55
* Fixed [rstudio/crosstalk#58](https://github.com/rstudio/crosstalk/issues/58), which caused Leaflet maps that used Crosstalk shared data in Shiny apps, to be redrawn at incorrect times.
6+
* Upgrade leaflet-provider to 1.4.0, enable more map variants such as CartoDB.Voyager (#567)
67

78

89

data/providers.details.rda

668 Bytes
Binary file not shown.

data/providers.rda

188 Bytes
Binary file not shown.

inst/htmlwidgets/lib/leaflet-providers/leaflet-providers.js

Lines changed: 85 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,6 @@
5050
};
5151
}
5252

53-
// If retina option is set
54-
if (provider.options.retina) {
55-
// Check retina screen
56-
if (options.detectRetina && L.Browser.retina) {
57-
// The retina option will be active now
58-
// But we need to prevent Leaflet retina mode
59-
options.detectRetina = false;
60-
} else {
61-
// No retina, remove option
62-
provider.options.retina = '';
63-
}
64-
}
65-
6653
// replace attribution placeholders with their values from toplevel provider attribution,
6754
// recursively
6855
var attributionReplacer = function (attr) {
@@ -113,7 +100,8 @@
113100
CH: {
114101
url: '//tile.osm.ch/switzerland/{z}/{x}/{y}.png',
115102
options: {
116-
maxZoom: 18
103+
maxZoom: 18,
104+
bounds: [[45, 5], [48, 11]]
117105
}
118106
},
119107
France: {
@@ -130,7 +118,7 @@
130118
}
131119
},
132120
BZH: {
133-
url: 'https://tile.openstreetmap.bzh/br/{z}/{x}/{y}.png',
121+
url: '//tile.openstreetmap.bzh/br/{z}/{x}/{y}.png',
134122
options: {
135123
attribution: '{attribution.OpenStreetMap}, Tiles courtesy of <a href="http://www.openstreetmap.bzh/" target="_blank">Breton OpenStreetMap Team</a>',
136124
bounds: [[46.2, -5.5], [50, 0.7]]
@@ -146,10 +134,10 @@
146134
'{attribution.OpenStreetMap}, <a href="http://www.openinframap.org/about.html">About OpenInfraMap</a>'
147135
},
148136
variants: {
149-
Power: 'power' ,
150-
Telecom: 'telecoms' ,
151-
Petroleum: 'petroleum' ,
152-
Water: 'water'
137+
Power: 'power',
138+
Telecom: 'telecoms',
139+
Petroleum: 'petroleum',
140+
Water: 'water'
153141
}
154142
},
155143
OpenSeaMap: {
@@ -261,7 +249,7 @@
261249
}
262250
},
263251
MapBox: {
264-
url: 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}',
252+
url: 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}{r}.png?access_token={accessToken}',
265253
options: {
266254
attribution:
267255
'Imagery from <a href="http://mapbox.com/about/maps/">MapBox</a> &mdash; ' +
@@ -272,7 +260,7 @@
272260
}
273261
},
274262
Stamen: {
275-
url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}',
263+
url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}',
276264
options: {
277265
attribution:
278266
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, ' +
@@ -292,6 +280,7 @@
292280
TonerLabels: 'toner-labels',
293281
TonerLite: 'toner-lite',
294282
Watercolor: {
283+
url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}',
295284
options: {
296285
variant: 'watercolor',
297286
minZoom: 1,
@@ -313,6 +302,7 @@
313302
}
314303
},
315304
TopOSMRelief: {
305+
url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}',
316306
options: {
317307
variant: 'toposm-color-relief',
318308
ext: 'jpg',
@@ -475,7 +465,10 @@
475465
normalNightMobile: 'normal.night.mobile',
476466
normalNightGrey: 'normal.night.grey',
477467
normalNightGreyMobile: 'normal.night.grey.mobile',
478-
468+
normalNightTransit: 'normal.night.transit',
469+
normalNightTransitMobile: 'normal.night.transit.mobile',
470+
redcuedDay: 'reduced.day',
471+
redcuedNight: 'reduced.night',
479472
basicMap: {
480473
options: {
481474
type: 'basetile'
@@ -506,6 +499,18 @@
506499
variant: 'hybrid.day.mobile'
507500
}
508501
},
502+
hybridDayTransit: {
503+
options: {
504+
base: 'aerial',
505+
variant: 'hybrid.day.transit'
506+
}
507+
},
508+
hybridDayGrey: {
509+
options: {
510+
base: 'aerial',
511+
variant: 'hybrid.grey.day'
512+
}
513+
},
509514
pedestrianDay: 'pedestrian.day',
510515
pedestrianNight: 'pedestrian.night',
511516
satelliteDay: {
@@ -547,7 +552,7 @@
547552
}
548553
},
549554
CartoDB: {
550-
url: 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/{variant}/{z}/{x}/{y}.png',
555+
url: 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.png',
551556
options: {
552557
attribution: '{attribution.OpenStreetMap} &copy; <a href="http://cartodb.com/attributions">CartoDB</a>',
553558
subdomains: 'abcd',
@@ -560,7 +565,11 @@
560565
PositronOnlyLabels: 'light_only_labels',
561566
DarkMatter: 'dark_all',
562567
DarkMatterNoLabels: 'dark_nolabels',
563-
DarkMatterOnlyLabels: 'dark_only_labels'
568+
DarkMatterOnlyLabels: 'dark_only_labels',
569+
Voyager: 'rastertiles/voyager',
570+
VoyagerNoLabels: 'rastertiles/voyager_nolabels',
571+
VoyagerOnlyLabels: 'rastertiles/voyager_only_labels',
572+
VoyagerLabelsUnder: 'rastertiles/voyager_labels_under'
564573
}
565574
},
566575
HikeBike: {
@@ -730,11 +739,61 @@
730739
}
731740
},
732741
Wikimedia: {
733-
url: 'https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png',
742+
url: 'https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}{r}.png',
734743
options: {
735744
attribution: '<a href="https://wikimediafoundation.org/wiki/Maps_Terms_of_Use">Wikimedia</a>',
736745
minZoom: 1,
737-
maxZoom: 18
746+
maxZoom: 19
747+
}
748+
},
749+
GeoportailFrance: {
750+
url: 'https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET=PM&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}',
751+
options: {
752+
attribution: '<a target="_blank" href="https://www.geoportail.gouv.fr/">Geoportail France</a>',
753+
bounds: [[-75, -180], [81, 180]],
754+
minZoom: 2,
755+
maxZoom: 18,
756+
// Get your own geoportail apikey here : http://professionnels.ign.fr/ign/contrats/
757+
// NB : 'choisirgeoportail' is a demonstration key that comes with no guarantee
758+
apikey: 'choisirgeoportail',
759+
format: 'image/jpeg',
760+
style : 'normal',
761+
variant: 'GEOGRAPHICALGRIDSYSTEMS.MAPS.SCAN-EXPRESS.STANDARD'
762+
},
763+
variants: {
764+
parcels: {
765+
options : {
766+
variant: 'CADASTRALPARCELS.PARCELS',
767+
maxZoom: 20,
768+
style : 'bdparcellaire',
769+
format: 'image/png'
770+
}
771+
},
772+
ignMaps: 'GEOGRAPHICALGRIDSYSTEMS.MAPS',
773+
maps: 'GEOGRAPHICALGRIDSYSTEMS.MAPS.SCAN-EXPRESS.STANDARD',
774+
orthos: {
775+
options: {
776+
maxZoom: 19,
777+
variant: 'ORTHOIMAGERY.ORTHOPHOTOS'
778+
}
779+
}
780+
}
781+
},
782+
OneMapSG: {
783+
url: '//maps-{s}.onemap.sg/v3/{variant}/{z}/{x}/{y}.png',
784+
options: {
785+
variant: 'Default',
786+
minZoom: 11,
787+
maxZoom: 18,
788+
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>'
790+
},
791+
variants: {
792+
Default: 'Default',
793+
Night: 'Night',
794+
Original: 'Original',
795+
Grey: 'Grey',
796+
LandLot: 'LandLot'
738797
}
739798
}
740799
};

inst/htmlwidgets/lib/leaflet-providers/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "leaflet-providers",
3-
"version": "1.1.17",
3+
"version": "1.4.0",
44
"description": "An extension to Leaflet that contains configurations for various free tile providers.",
55
"main": "leaflet-providers.js",
66
"repository": {
@@ -9,10 +9,11 @@
99
},
1010
"scripts": {
1111
"test": "npm run lint && npm run testsuite",
12-
"testsuite": "phantomjs ./node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js tests/index.html",
12+
"testsuite": "mocha-chrome tests/index.html",
1313
"lint": "eslint --config .eslintrc leaflet-providers.js index.html preview/*.js preview/*.html tests/*",
1414
"min": "uglifyjs leaflet-providers.js -mc -o leaflet-providers.min.js",
15-
"release": "mversion patch -m"
15+
"release": "mversion patch -m",
16+
"release-minor": "mversion minor -m"
1617
},
1718
"license": "BSD-2-Clause",
1819
"bugs": {
@@ -26,13 +27,12 @@
2627
],
2728
"devDependencies": {
2829
"chai": "^4.1.2",
29-
"eslint": "^3.16.1",
30-
"eslint-plugin-html": "^2.0.1",
31-
"mocha": "^3.2.0",
32-
"mocha-phantomjs-core": "^2.1.1",
33-
"mversion": "^1.10.1",
34-
"phantomjs-prebuilt": "^2.1.16",
35-
"uglify-js": "^2.4.15"
30+
"eslint": "^5.4.0",
31+
"eslint-plugin-html": "^4.0.5",
32+
"mocha": "^5.2.0",
33+
"mocha-chrome": "^1.1.0",
34+
"mversion": "^1.12.0",
35+
"uglify-js": "^2.8.29"
3636
},
3737
"autoupdate": {
3838
"source": "git",

0 commit comments

Comments
 (0)