@@ -271,6 +271,7 @@ addRasterImage <- function(
271
271
project = project ,
272
272
method = method ,
273
273
maxBytes = maxBytes ,
274
+ options = options ,
274
275
data = data
275
276
)
276
277
} else if (inherits(x , " RasterLayer" )) {
@@ -285,6 +286,7 @@ addRasterImage <- function(
285
286
project = project ,
286
287
method = method ,
287
288
maxBytes = maxBytes ,
289
+ options = options ,
288
290
data = data
289
291
)
290
292
} else {
@@ -392,6 +394,7 @@ addRasterImage_RasterLayer <- function(
392
394
project = TRUE ,
393
395
method = c(" auto" , " bilinear" , " ngb" ),
394
396
maxBytes = 4 * 1024 * 1024 ,
397
+ options = gridOptions(),
395
398
data = getMapData(map )
396
399
) {
397
400
@@ -450,7 +453,7 @@ addRasterImage_RasterLayer <- function(
450
453
list (raster :: ymin(bounds ), raster :: xmax(bounds ))
451
454
)
452
455
453
- invokeMethod(map , data , " addRasterImage" , uri , latlng , opacity , attribution , layerId , group , options ) %> %
456
+ invokeMethod(map , data , " addRasterImage" , uri , latlng , layerId , group , options ) %> %
454
457
expandLimits(
455
458
c(raster :: ymin(bounds ), raster :: ymax(bounds )),
456
459
c(raster :: xmin(bounds ), raster :: xmax(bounds ))
@@ -468,6 +471,7 @@ addRasterImage_SpatRaster <- function(
468
471
project = TRUE ,
469
472
method = c(" auto" , " bilinear" , " ngb" ),
470
473
maxBytes = 4 * 1024 * 1024 ,
474
+ options = gridOptions(),
471
475
data = getMapData(map )
472
476
) {
473
477
if (! is_installed(" terra" , " 1.6-3" )) { # for terra::has.RGB()
@@ -477,6 +481,9 @@ addRasterImage_SpatRaster <- function(
477
481
)
478
482
}
479
483
484
+ options $ opacity <- opacity
485
+ options $ attribution <- attribution
486
+
480
487
if (terra :: has.RGB(x )) {
481
488
# RGB(A) channels to color table
482
489
x <- terra :: colorize(x , " col" )
@@ -554,7 +561,7 @@ addRasterImage_SpatRaster <- function(
554
561
list (terra :: ymin(bounds ), terra :: xmax(bounds ))
555
562
)
556
563
557
- invokeMethod(map , data , " addRasterImage" , uri , latlng , opacity , attribution , layerId , group ) %> %
564
+ invokeMethod(map , data , " addRasterImage" , uri , latlng , layerId , group , options ) %> %
558
565
expandLimits(
559
566
c(terra :: ymin(bounds ), terra :: ymax(bounds )),
560
567
c(terra :: xmin(bounds ), terra :: xmax(bounds ))
0 commit comments