Skip to content

Commit d588f89

Browse files
committed
Addressed code reivew comments from #293
1 parent 9330ae9 commit d588f89

File tree

3 files changed

+32
-31
lines changed

3 files changed

+32
-31
lines changed

R/plugin-graticule.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ addGraticule <- function(
3434
) {
3535
map$dependencies <- c(map$dependencies, leafletGraticuleDependencies())
3636
invokeMethod(
37-
map
38-
, getMapData(map)
39-
, 'addGraticule'
40-
, interval
41-
, style
42-
, layerId
43-
, group
37+
map,
38+
getMapData(map),
39+
'addGraticule',
40+
interval,
41+
style,
42+
layerId,
43+
group
4444
)
4545
}

R/plugin-minimap.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ leafletMiniMapDependencies <- function() {
1616
#' \url{https://github.com/Norkart/Leaflet-MiniMap}
1717
#'
1818
#' @param map a map widget object
19-
#' @param tiles URL for tiles or one of the pre-defined providers.
2019
#' @param position The standard Leaflet.Control position parameter,
2120
#' used like all the other controls.
2221
#' Defaults to 'bottomright'.
@@ -52,6 +51,7 @@ leafletMiniMapDependencies <- function() {
5251
#' a Path.Options (\url{http://leafletjs.com/reference.html#path-options}) object.
5352
#' (Clickable will always be overridden and set to false.)
5453
#' @param strings Overrides the default strings allowing for translation.
54+
#' @param tiles URL for tiles or one of the pre-defined providers.
5555
#' @param mapOptions Sets Leaflet options for the MiniMap map.
5656
#' It does not override the MiniMap default map options but extends them.
5757
#' @examples
@@ -65,7 +65,6 @@ leafletMiniMapDependencies <- function() {
6565
#' @export
6666
addMiniMap <- function(
6767
map,
68-
tiles = NULL,
6968
position = 'bottomright',
7069
width = 150,
7170
height = 150,
@@ -82,6 +81,7 @@ addMiniMap <- function(
8281
shadowRectOptions = list(color= '#000000', weight= 1, clickable= FALSE,
8382
opacity= 0, fillOpacity= 0),
8483
strings = list(hideText= 'Hide MiniMap', showText= 'Show MiniMap'),
84+
tiles = NULL,
8585
mapOptions = list()
8686
) {
8787

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
LeafletWidget.methods.addMiniMap = function(tilesURL, tilesProvider, position,
1+
LeafletWidget.methods.addMiniMap =
2+
function(tilesURL, tilesProvider, position,
23
width, height, collapsedWidth, collapsedHeight , zoomLevelOffset,
34
zoomLevelFixed, centerFixed, zoomAnimation , toggleDisplay, autoToggleDisplay,
4-
minimized, aimingRectOptions,
5-
shadowRectOptions, strings, mapOptions) {
5+
minimized, aimingRectOptions, shadowRectOptions, strings, mapOptions) {
6+
67
(function() {
78
if(this.minimap) {
89
this.minimap.removeFrom( this );
@@ -19,24 +20,24 @@
1920
layer = new L.tileLayer(tilesURL);
2021
}
2122

22-
this.minimap = new L.Control.MiniMap(layer, {
23-
position: position,
24-
width: width,
25-
height: height,
26-
collapsedWidth: collapsedWidth,
27-
collapsedHeight: collapsedWidth,
28-
zoomLevelOffset: zoomLevelOffset,
29-
zoomLevelFixed: zoomLevelFixed,
30-
centerFixed: centerFixed,
31-
zoomAnimation: zoomAnimation,
32-
toggleDisplay: toggleDisplay,
33-
autoToggleDisplay: autoToggleDisplay,
34-
minimized: minimized,
35-
aimingRectOptions: aimingRectOptions,
36-
shadowRectOptions: shadowRectOptions,
37-
strings: strings,
38-
mapOptions: mapOptions
39-
});
40-
this.minimap.addTo(this);
23+
this.minimap = new L.Control.MiniMap(layer, {
24+
position: position,
25+
width: width,
26+
height: height,
27+
collapsedWidth: collapsedWidth,
28+
collapsedHeight: collapsedWidth,
29+
zoomLevelOffset: zoomLevelOffset,
30+
zoomLevelFixed: zoomLevelFixed,
31+
centerFixed: centerFixed,
32+
zoomAnimation: zoomAnimation,
33+
toggleDisplay: toggleDisplay,
34+
autoToggleDisplay: autoToggleDisplay,
35+
minimized: minimized,
36+
aimingRectOptions: aimingRectOptions,
37+
shadowRectOptions: shadowRectOptions,
38+
strings: strings,
39+
mapOptions: mapOptions
40+
});
41+
this.minimap.addTo(this);
4142
}).call(this);
4243
};

0 commit comments

Comments
 (0)