diff --git a/R/addGeoRaster.R b/R/addGeoRaster.R index 971c8c3..d16e343 100644 --- a/R/addGeoRaster.R +++ b/R/addGeoRaster.R @@ -2,7 +2,9 @@ addGeoRaster = function(map, file = NULL, url = NULL, group = NULL, - layerId = NULL) { + layerId = NULL, + resolution = 96, + opacity = 0.8) { if (inherits(map, "mapview")) map = mapview2leaflet(map) @@ -35,6 +37,8 @@ addGeoRaster = function(map, , url , group , layerId + , resolution + , opacity ) } else { map$dependencies <- c( @@ -49,6 +53,8 @@ addGeoRaster = function(map, , url , group , layerId + , resolution + , opacity ) } diff --git a/inst/htmlwidgets/lib/georaster-for-leaflet/georaster-binding.js b/inst/htmlwidgets/lib/georaster-for-leaflet/georaster-binding.js index 13afbb6..62ae63f 100644 --- a/inst/htmlwidgets/lib/georaster-for-leaflet/georaster-binding.js +++ b/inst/htmlwidgets/lib/georaster-for-leaflet/georaster-binding.js @@ -1,6 +1,8 @@ LeafletWidget.methods.addGeoRaster = function (url, group, - layerId) { + layerId, + resolution, + opacity) { var map = this; @@ -19,7 +21,8 @@ LeafletWidget.methods.addGeoRaster = function (url, console.log("georaster:", georaster); var layer = new GeoRasterLayer({ georaster: georaster, - resolution: 96 + resolution: resolution, + opacity: opacity }); layer.addTo(map); map.fitBounds(layer.getBounds());