Skip to content

Commit

Permalink
Add anchors to links
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Dec 17, 2024
1 parent bbbadc7 commit 0336d6d
Show file tree
Hide file tree
Showing 13 changed files with 119 additions and 84 deletions.
4 changes: 2 additions & 2 deletions R/color.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
#' specified in at
#' @param at numeric vector giving the breakpoints for the colors
#' @param na.color the color for NA values.
#' @param ... additional arguments passed on to \code{\link{level.colors}}
#' @param ... additional arguments passed on to \code{\link[lattice]{level.colors}}
#'
#' @author
#' Tim Appelhans
#'
#' @seealso
#' \code{\link{level.colors}}
#' \code{\link[lattice]{level.colors}}
#'
#' @name mapviewColors
#' @export mapviewColors
Expand Down
4 changes: 2 additions & 2 deletions R/extent.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
#' @param map a leaflet or mapview map the extent should be added to. If NULL
#' standard background layers are created.
#' @param popup a \code{list} of HTML strings with the popup contents, usually
#' created from \code{\link{popupTable}}. See \code{\link{addControl}} for
#' created from \code{\link[leafpop]{popupTable}}. See \code{\link[leaflet]{addControl}} for
#' details.
#' @param layer.name the name of the layer to be shown on the map.
#' @param alpha.regions opacity of the fills or the raster layer(s).
#' @param label a character vector of labels to be shown on mouseover. See
#' \code{\link{addControl}} for details.
#' @param ... additional arguments passed on to \code{\link{addRectangles}}
#' @inheritDotParams leaflet::addRectangles
#'
#' @author
#' Tim Appelhans
Expand Down
52 changes: 26 additions & 26 deletions R/mapView.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if ( !isGeneric('mapView') ) {
#' @param map an optional existing map to be updated/added to.
#' @param band for stars layers, the band number to be plotted.
#' @param pane name of the map pane in which to render features. See
#' \code{\link{addMapPane}} for details. Currently only supported for vector layers.
#' \code{\link[leaflet]{addMapPane}} for details. Currently only supported for vector layers.
#' Ignored if \code{canvas = TRUE}. The default \code{"auto"} will create different panes
#' for points, lines and polygons such that points overlay lines overlay polygons.
#' Set to \code{NULL} to get default leaflet behaviour where allfeatures
Expand All @@ -49,7 +49,7 @@ if ( !isGeneric('mapView') ) {
#' See \code{\link{levelplot}} for details.
#' @param na.color color for missing values
#' @param use.layer.names should layer names of the Raster* object be used?
#' @param map.types character spcifications for the base maps.
#' @param map.types character specifications for the base maps.
#' see \url{https://leaflet-extras.github.io/leaflet-providers/preview/}
#' for available options.
#' @param burst whether to show all (TRUE) or only one (FALSE) layer(s).
Expand All @@ -75,13 +75,13 @@ if ( !isGeneric('mapView') ) {
#' Defaults to TRUE
#' @param popup either \code{logical}, \code{character vector} or a \code{list}
#' of HTML strings with the popup contents, usually created from
#' \code{\link[leafpop]{popupTable}}. See \code{\link{addControl}} for details.
#' \code{\link[leafpop]{popupTable}}. See \code{\link[leaflet]{addControl}} for details.
#' If \code{FALSE} or \code{NULL} no popups will be created, if \code{TRUE}
#' a table with all feature attributes/columns will be created.
#' If a \code{character vector} of column names, the table will only show the
#' respective column entries.
#' @param label For vector data (sf/sp) a character vector of labels to be
#' shown on mouseover. See \code{\link{addControl}} for details. For raster
#' shown on mouseover. See \code{\link[leaflet]{addControl}} for details. For raster
#' data (Raster*/stars) a logical indicating whether to add image query.
#' @param native.crs logical whether to reproject to web map coordinate
#' reference system (web mercator - epsg:3857) or render using native CRS of
Expand All @@ -98,7 +98,7 @@ if ( !isGeneric('mapView') ) {
#' layer is of class \code{factor} in which case "ngb" is used.
#' @param highlight either \code{FALSE}, \code{NULL} or a list of styling
#' options for feature highlighting on mouse hover.
#' See \code{\link{highlightOptions}} for details.
#' See \code{\link[leaflet]{highlightOptions}} for details.
#' @param maxpoints the maximum number of points making up the geometry.
#' In case of lines and polygons this refers to the number of vertices. See
#' Details for more information.
Expand All @@ -107,21 +107,21 @@ if ( !isGeneric('mapView') ) {
#' @param query.digits for raster methods only. The amount of digits to be shown
#' by raster value query. Ignored if \code{label = FALSE}.
#' @param query.position for raster methods only. The position of the raster
#' value query info box. See \code{position} argument of \code{\link{addLegend}}
#' value query info box. See \code{position} argument of \code{\link[leaflet]{addLegend}}
#' for possible values. Ignored if \code{label = FALSE}.
#' @param query.prefix for raster methods only. a character string to be shown
#' as prefix for the layerId. Ignored if \code{label = FALSE}.
#' @param hide either a logical, a vector of layer names or a vector of layer indices.
#' See Details for more information on what exactly it does for different raster types.
#' @param ... additional arguments passed on to respective functions.
#' See \code{\link{addRasterImage}}, \code{\link{addCircles}},
#' \code{\link{addPolygons}}, \code{\link{addPolylines}} for details.
#' See \code{\link[leaflet]{addRasterImage}}, \code{\link[leaflet]{addCircles}},
#' \code{\link[leaflet]{addPolygons}}, \code{\link[leaflet]{addPolylines}} for details.
#' Furthermore, you can pass hidden arguments to some methods. See Details for
#' a list of supported hidden arguments.
#'
#' @details
#' \code{maxpoints} is taken to determine when to switch rendering from svg
#' to canvas overlay for perfomance. The threshold calculation is done as follows: \cr
#' to canvas overlay for performance. The threshold calculation is done as follows: \cr
#' if the number of points (in case of point data) or vertices (in case of
#' polygon or line data) > \code{maxpoints} then render using special render
#' function. Within this render function we approximate the complexity of
Expand Down Expand Up @@ -460,7 +460,7 @@ setMethod('mapView', signature(x = 'SpatRaster'), .stars_method)


## Raster Stack/Brick ===========================================================
#' @describeIn mapView \code{\link{stack}} / \code{\link{brick}}
#' @describeIn mapView \code{\link[raster]{stack}} / \code{\link[raster]{brick}}

setMethod('mapView', signature(x = 'RasterStackBrick'),
function(x,
Expand Down Expand Up @@ -531,7 +531,7 @@ setMethod('mapView', signature(x = 'RasterStackBrick'),


## Satellite object =======================================================
#' @describeIn mapView \code{\link{satellite}}
#' @describeIn mapView \code{\link[satellite]{satellite}}

setMethod('mapView', signature(x = 'Satellite'),
function(x,
Expand Down Expand Up @@ -840,7 +840,7 @@ setMethod('mapView', signature(x = 'SpatVector'), .sf_method)


## sfc ====================================================================
#' @describeIn mapView \code{\link{st_sfc}}
#' @describeIn mapView \code{\link[sf]{st_sfc}}

setMethod('mapView', signature(x = 'sfc'),
function(x,
Expand Down Expand Up @@ -1108,7 +1108,7 @@ setMethod('mapView', signature(x = 'numeric'),
#' @param aspect the ratio of x/y axis corrdinates to adjust the plotting
#' space to fit the screen. Only relevant for the data.frame method.
#' @param crs an optional crs specification for the provided data to enable
#' rendering on a basemap. See argument description in \code{\link{st_sf}}
#' rendering on a basemap. See argument description in \code{\link[sf]{st_sf}}
#' for details.
setMethod('mapView', signature(x = 'data.frame'),
function(x,
Expand Down Expand Up @@ -1151,7 +1151,7 @@ setMethod('mapView', signature(x = 'data.frame'),


## XY =====================================================================
#' @describeIn mapView \code{\link{st_sfc}}
#' @describeIn mapView \code{\link[sf]{st_sfc}}

setMethod('mapView', signature(x = 'XY'),
function(x,
Expand Down Expand Up @@ -1219,7 +1219,7 @@ setMethod('mapView', signature(x = 'XY'),


## XYZ ====================================================================
#' @describeIn mapView \code{\link{st_sfc}}
#' @describeIn mapView \code{\link[sf]{st_sfc}}

setMethod('mapView', signature(x = 'XYZ'),
function(x,
Expand All @@ -1233,7 +1233,7 @@ setMethod('mapView', signature(x = 'XYZ'),


## XYM ====================================================================
#' @describeIn mapView \code{\link{st_sfc}}
#' @describeIn mapView \code{\link[sf]{st_sfc}}

setMethod('mapView', signature(x = 'XYM'),
function(x,
Expand All @@ -1247,7 +1247,7 @@ setMethod('mapView', signature(x = 'XYM'),


## XYZM ===================================================================
#' @describeIn mapView \code{\link{st_sfc}}
#' @describeIn mapView \code{\link[sf]{st_sfc}}

setMethod('mapView', signature(x = 'XYZM'),
function(x,
Expand All @@ -1261,7 +1261,7 @@ setMethod('mapView', signature(x = 'XYZM'),


## bbox =======================================================
#' @describeIn mapView \code{\link{st_bbox}}
#' @describeIn mapView \code{\link[sf]{st_bbox}}

setMethod('mapView', signature(x = 'bbox'),
function(x,
Expand Down Expand Up @@ -1416,7 +1416,7 @@ setMethod('mapview', signature('ANY'),
######## SP ###############################################################

## SpatialPixelsDataFrame =================================================
#' @describeIn mapView \code{\link{SpatialPixelsDataFrame}}
#' @describeIn mapView \code{\link[sp]{SpatialPixelsDataFrame}}
#'
setMethod('mapView', signature(x = 'SpatialPixelsDataFrame'),
function(x,
Expand Down Expand Up @@ -1482,7 +1482,7 @@ setMethod('mapView', signature(x = 'SpatialPixelsDataFrame'),


## SpatialGridDataFrame =================================================
#' @describeIn mapView \code{\link{SpatialGridDataFrame}}
#' @describeIn mapView \code{\link[sp]{SpatialGridDataFrame}}
#'
setMethod('mapView', signature(x = 'SpatialGridDataFrame'),
function(x,
Expand Down Expand Up @@ -1548,7 +1548,7 @@ setMethod('mapView', signature(x = 'SpatialGridDataFrame'),


## SpatialPointsDataFrame =================================================
#' @describeIn mapView \code{\link{SpatialPointsDataFrame}}
#' @describeIn mapView \code{\link[sp]{SpatialPointsDataFrame}}
setMethod('mapView', signature(x = 'SpatialPointsDataFrame'),
function(x,
zcol = NULL,
Expand All @@ -1562,7 +1562,7 @@ setMethod('mapView', signature(x = 'SpatialPointsDataFrame'),


## SpatialPoints ==========================================================
#' @describeIn mapView \code{\link{SpatialPoints}}
#' @describeIn mapView \code{\link[sp]{SpatialPoints}}

setMethod('mapView', signature(x = 'SpatialPoints'),
function(x,
Expand All @@ -1577,7 +1577,7 @@ setMethod('mapView', signature(x = 'SpatialPoints'),


## SpatialPolygonsDataFrame ===============================================
#' @describeIn mapView \code{\link{SpatialPolygonsDataFrame}}
#' @describeIn mapView \code{\link[sp]{SpatialPolygonsDataFrame}}

setMethod('mapView', signature(x = 'SpatialPolygonsDataFrame'),
function(x,
Expand All @@ -1592,7 +1592,7 @@ setMethod('mapView', signature(x = 'SpatialPolygonsDataFrame'),


## SpatialPolygons ========================================================
#' @describeIn mapView \code{\link{SpatialPolygons}}
#' @describeIn mapView \code{\link[sp]{SpatialPolygons}}

setMethod('mapView', signature(x = 'SpatialPolygons'),
function(x,
Expand All @@ -1607,7 +1607,7 @@ setMethod('mapView', signature(x = 'SpatialPolygons'),


## SpatialLinesDataFrame =================================================
#' @describeIn mapView \code{\link{SpatialLinesDataFrame}}
#' @describeIn mapView \code{\link[sp]{SpatialLinesDataFrame}}

setMethod('mapView', signature(x = 'SpatialLinesDataFrame'),
function(x,
Expand All @@ -1622,7 +1622,7 @@ setMethod('mapView', signature(x = 'SpatialLinesDataFrame'),


## SpatialLines ===========================================================
#' @describeIn mapView \code{\link{SpatialLines}}
#' @describeIn mapView \code{\link[sp]{SpatialLines}}

setMethod('mapView', signature(x = 'SpatialLines'),
function(x,
Expand Down
18 changes: 9 additions & 9 deletions R/options.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
#' @param homebutton.pos character. Where should the homebutton(s) be
#' placed? One of "topleft", "topright", "bottomleft", "bottomright".
#' @param native.crs logical whether to reproject to web map coordinate
#' reference system (web mercator - epsg:3857) or render using native CRS of
#' reference system (web Mercator - epsg:3857) or render using native CRS of
#' the supplied data (can also be NA). Default is FALSE which will render in
#' web mercator. If set to TRUE now background maps will be drawn (but rendering
#' web Mercator. If set to TRUE now background maps will be drawn (but rendering
#' may be much quicker as no reprojecting is necessary).
#' @param raster.size numeric. see the maxBytes argument in \code{\link{addRasterImage}}
#' @param raster.size numeric. see the maxBytes argument in \code{\link[leaflet]{addRasterImage}}
#' @param mapview.maxpixels numeric. The maximum amount of pixels allowed for Raster*
#' objects to be rendered with \code{mapview}. Defaults to 500000.
#' Set this higher if you have a potent machine or are patient enough to wait a little.
Expand All @@ -66,7 +66,7 @@
#' @param query.digits for raster methods only. The amount of digits to be shown
#' by raster value query. Ignored if \code{label = FALSE}.
#' @param query.position for raster methods only. The position of the raster
#' value query info box. See \code{position} argument of \code{\link{addLegend}}
#' value query info box. See \code{position} argument of \code{\link[leaflet]{addLegend}}
#' for possible values. Ignored if \code{label = FALSE}.
#' @param query.prefix for raster methods only. a character string to be shown
#' as prefix for the layerId. Ignored if \code{label = FALSE}.
Expand All @@ -86,22 +86,22 @@
#' This means that standard functionality is reduced.
#' For example adding layers via "+" is not possible anymore.
#' @param pane name of the map pane in which to render features. See
#' \code{\link{addMapPane}} for details. Currently only supported for vector layers.
#' \code{\link[leaflet]{addMapPane}} for details. Currently only supported for vector layers.
#' Ignored if \code{canvas = TRUE}. The default \code{"auto"} will create different panes
#' for points, lines and polygons such that points overlay lines overlay polygons.
#' Set to \code{NULL} to get default leaflet behaviour where allfeatures
#' Set to \code{NULL} to get default leaflet behaviour where all features
#' are rendered in the same pane and layer order is determined automatically/sequentially.
#' @param cex numeric or attribute name(s) or column number(s) in attribute table
#' of the column(s) to be used for defining the size of circles.
#' @param alpha opacity of lines.
#' @param watch whether to watch a certain environment and automatically
#' render changes to the list of spatial data in that environment. See
#' \link{mapviewWatcher} for details.
#' @param fgb if set to \code{TRUE} mapview will not use 'clasical' leaflet/htmlwidgets
#' @param fgb if set to \code{TRUE} mapview will not use 'classical' leaflet/htmlwidgets
#' rendering (which embeds data directly in the html) but leverage the speed of
#' a file format called flatgeobuf (hence, fgb). This has the added benefit that
#' data is being streamed onto the map, which makes for a pleasant user experience.
#' It should also help to visualise larger data sets due to a reduced memeory footprint.
#' It should also help to visualise larger data sets due to a reduced memory footprint.
#' A note of warning, data will be attached to the html
#' via a <src=...> call which means that the html is not selfcontained anymore
#' (so it cannot be used without an accompanying folder).
Expand All @@ -118,7 +118,7 @@
#' If no arguments are provided the options are printed.
#'
#' @seealso
#' \code{\link{rasterOptions}}, \code{\link{options}}
#' \code{\link[raster]{rasterOptions}}, \code{\link{options}}
#'
#' @examples
#' mapviewOptions()
Expand Down
4 changes: 2 additions & 2 deletions R/shiny-mapview.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' @param expr An expression that generates an HTML widget
#' @param env The environment in which to evaluate expr
#' @param quoted Is expr a quoted expression (with quote())?
#' @param quoted Is `expr` a quoted expression (with `quote()`)?
#' This is useful if you want to save an expression in a variable
#'
#' @export
Expand All @@ -19,7 +19,7 @@ renderMapview <- function(expr, env = parent.frame(), quoted = FALSE) {
#'
#' @param outputId Output variable to read from
#' @param width,height the width and height of the map
#' (see \code{\link{shinyWidgetOutput}})
#' (see \code{\link[htmlwidgets]{shinyWidgetOutput}})
#'
#' @export
#'
Expand Down
2 changes: 1 addition & 1 deletion R/viewRGB.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' that they represent the red, green and blue channel. This function can
#' be used to make 'true (or false) color images' from Landsat and other
#' multi-band satellite images. Note, this text is plagiarized, i.e. copied
#' from \code{\link{plotRGB}}.
#' from [raster::plotRGB()].
#'
#' @param x a RasterBrick, RasterStack
#' @param r integer. Index of the Red channel/band, between 1 and nlayers(x)
Expand Down
Loading

0 comments on commit 0336d6d

Please sign in to comment.