| Title: | Polar OpenLayers |
|---|---|
| Description: | A minimal set of bindings to the OpenLayers javascript library, with a focus on polar mapping applications. |
| Authors: | Ben Raymond [aut, cre], Stefan Kuethe [ctb] (Author of https://github.com/crazycapivara/openlayers/, of which polr is a reimplementation and extension (of a sort)), OpenLayers contributors [ctb] (OpenLayers javascript library) |
| Maintainer: | Ben Raymond <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1 |
| Built: | 2026-06-01 07:45:27 UTC |
| Source: | https://github.com/SCAR/polr |
Add clustered points
add_clustered_points( map, lon, lat, cluster_style = NULL, cluster_hull_style = NULL, marker_style = NULL, popup = NULL, cluster_options = list(distance = 10, min_distance = 0), ... )add_clustered_points( map, lon, lat, cluster_style = NULL, cluster_hull_style = NULL, marker_style = NULL, popup = NULL, cluster_options = list(distance = 10, min_distance = 0), ... )
map |
pol or pol_proxy: map to add the layer to |
lon |
numeric: longitudes |
lat |
numeric: latitudes |
cluster_style |
: a style object as returned by |
cluster_hull_style |
: a style object as returned by |
marker_style |
: a style object as returned by |
popup |
character: popups to show, one per point |
cluster_options |
list: named list with components |
... |
: named vector layer options https://openlayers.org/en/latest/apidoc/module-ol_layer_Vector-VectorLayer.html |
A pol map object
Add cloud-optimised geotiff layer
add_cog(map, sources, geotiff_source_options = NULL, ...)add_cog(map, sources, geotiff_source_options = NULL, ...)
map |
pol or pol_proxy: map to add the layer to |
sources |
: either a character vector of one or more URLs, or a list of |
geotiff_source_options |
list: geotiff source options https://openlayers.org/en/latest/apidoc/module-ol_source_GeoTIFF.html#~GeoTIFFSourceOptions |
... |
: named webGL tile source options https://openlayers.org/en/latest/apidoc/module-ol_layer_WebGLTile.html |
A pol map object
Add a flatgeobuf vector layer
add_fgb(map, url, file, style = NULL, popup = NULL, ...)add_fgb(map, url, file, style = NULL, popup = NULL, ...)
map |
pol or pol_proxy: map to add the layer to |
url |
string: URL to the flatgeobuf. Ignored if |
file |
string: path to the flatgeobuf file. Note that |
style |
: either a style object as returned by |
popup |
character: popups to show, one per point |
... |
: named vector layer options https://openlayers.org/en/latest/apidoc/module-ol_layer_Vector-VectorLayer.html |
A pol map object
https://flatgeobuf.org/examples/openlayers/
Add a geoJSON vector layer
add_geojson(map, data, file, style = NULL, popup = NULL, data_proj = NULL, ...)add_geojson(map, data, file, style = NULL, popup = NULL, data_proj = NULL, ...)
map |
pol or pol_proxy: map to add the layer to |
data |
string: geoJSON data as a string. Ignored if |
file |
string: path to geojson file |
style |
: either a style object as returned by |
popup |
character: popups to show, one per point |
data_proj |
string: the projection code of the geojson data. If omitted, it will be derived from the data where possible. If it cannot, the data will not be reprojected to the map's projection |
... |
: named vector layer options https://openlayers.org/en/latest/apidoc/module-ol_layer_Vector-VectorLayer.html |
A pol map object
Add graticule
add_graticule( map, lons = seq(-180, 150, by = 30), lats = seq(-90, -40, by = 10), nverts = 51, xlim = range(lons), ylim = range(lats), style = NULL, no_legend = TRUE, ... )add_graticule( map, lons = seq(-180, 150, by = 30), lats = seq(-90, -40, by = 10), nverts = 51, xlim = range(lons), ylim = range(lats), style = NULL, no_legend = TRUE, ... )
map |
pol or pol_proxy: map to add the layer to |
lons |
numeric: longitudes for meridional lines |
lats |
numeric: latitudes for parallel lines |
nverts |
numeric: number of discrete vertices for each segment |
xlim |
numeric: maximum range of parallel lines |
ylim |
numeric: maximum range of meridional lines |
style |
: either a style object as returned by |
no_legend |
logical: if |
... |
: named vector layer options https://openlayers.org/en/latest/apidoc/module-ol_layer_Vector-VectorLayer.html |
A pol map object
Add layer switcher
add_layer_switcher(map, target_id)add_layer_switcher(map, target_id)
map |
pol or pol_proxy: map to add the layer switcher to |
target_id |
string: ID of the html element to add the switcher to. If missing, the switcher will be placed inside the map pane |
A pol map object
Add points
add_points(map, lon, lat, style = NULL, popup = NULL, ...)add_points(map, lon, lat, style = NULL, popup = NULL, ...)
map |
pol or pol_proxy: map to add the layer to |
lon |
numeric: longitudes |
lat |
numeric: latitudes |
style |
: either a style object as returned by |
popup |
character: popups to show, one per point |
... |
: named vector layer options https://openlayers.org/en/latest/apidoc/module-ol_layer_Vector-VectorLayer.html |
A pol map object
Add WMS tile layer to a map
add_wms_tiles( map, url, layers, wms_params = NULL, tile_wms_options = list(), ... )add_wms_tiles( map, url, layers, wms_params = NULL, tile_wms_options = list(), ... )
map |
pol or pol_proxy: map to add the layer to |
url |
string: URL to the WMS server |
layers |
character: WMS layer names to include |
wms_params |
list: |
tile_wms_options |
list: https://openlayers.org/en/latest/apidoc/module-ol_source_TileWMS-TileWMS.html |
... |
: named tile layer options https://openlayers.org/en/latest/apidoc/module-ol_layer_Tile-TileLayer.html |
A pol map object
Add WMTS tile layer to a map from a WMTS server capabilities endpoint
add_wmts_from_capabilities(map, url, layer, wmts_options = list(), ...)add_wmts_from_capabilities(map, url, layer, wmts_options = list(), ...)
map |
pol or pol_proxy: map to add the layer to |
url |
string: URL to the WMTSCapabilities.xml document |
layer |
string: layer name |
wmts_options |
named list: other WMTS options as per https://openlayers.org/en/latest/apidoc/module-ol_source_WMTS.html#.optionsFromCapabilities |
... |
: named options as per https://openlayers.org/en/latest/apidoc/module-ol_layer_Tile-TileLayer.html |
A pol map object
Create a polar OpenLayers map object
pol( view_options = list(), control_options = list(zoom = TRUE, rotate = FALSE), width = NULL, height = NULL, elementId = NULL )pol( view_options = list(), control_options = list(zoom = TRUE, rotate = FALSE), width = NULL, height = NULL, elementId = NULL )
view_options |
list: https://openlayers.org/en/latest/apidoc/module-ol_View.html#~ViewOptions. By default the projection will be set to "EPSG:3031" (Antarctic polar stereographic) |
control_options |
list: https://openlayers.org/en/latest/apidoc/module-ol_control_defaults.html#~DefaultsOptions |
width, height
|
: Must be a valid CSS unit (like |
elementId |
string: element ID |
Create a colour palette to use with a raster
pol_colourmap(col, range = c(0, 1), breaks, with_nodata = TRUE) pol_colormap(col, range = c(0, 1), breaks, with_nodata = TRUE)pol_colourmap(col, range = c(0, 1), breaks, with_nodata = TRUE) pol_colormap(col, range = c(0, 1), breaks, with_nodata = TRUE)
col |
character: vector of hex colour strings |
range |
numeric: data range, noting that by default a layer's values are scaled to the range 0-1 |
breaks |
numeric: optional vector of breaks, same length as |
with_nodata |
logical: if |
An object of class pol_colourmap
Provides an alternative way of specifying a geotiff source to use in add_cog(), giving more control beyond just the source URL.
pol_geotiff_source(url, overviews, min, max, nodata, bands)pol_geotiff_source(url, overviews, min, max, nodata, bands)
url |
string: URL |
overviews |
character: overview URLs |
min |
numeric: minimum source data value |
max |
numeric: maximum source data value |
nodata |
numeric: the source data value representing "no data" |
bands |
numeric: band numbers to be read from (numbered starting from 1) |
An object of class pol_geotiff_source
https://openlayers.org/en/latest/apidoc/module-ol_source_GeoTIFF.html#~SourceInfo
Modify a pol object inside a Shiny app
pol_proxy( outputId, session = shiny::getDefaultReactiveDomain(), deferUntilFlush = TRUE )pol_proxy( outputId, session = shiny::getDefaultReactiveDomain(), deferUntilFlush = TRUE )
outputId |
string: the ID of the map |
session |
the Shiny session object to which the map belongs; usually the default value will suffice. |
deferUntilFlush |
logical: if |
Style
pol_style( fill = NULL, image = NULL, icon = NULL, shape = NULL, circle = NULL, stroke = NULL, text = NULL, z_index = NULL )pol_style( fill = NULL, image = NULL, icon = NULL, shape = NULL, circle = NULL, stroke = NULL, text = NULL, z_index = NULL )
An oject of class pol_style
https://openlayers.org/en/latest/apidoc/module-ol_style_Style.html
mystyle <- pol_style(stroke = list(color = "green"))mystyle <- pol_style(stroke = list(color = "green"))
Output and render functions for using pol within Shiny applications and interactive Rmd documents.
polOutput(outputId, width = "100%", height = "400px") renderPol(expr, env = parent.frame(), quoted = FALSE)polOutput(outputId, width = "100%", height = "400px") renderPol(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width, height
|
Must be a valid CSS unit (like |
expr |
An expression that generates a pol |
env |
The environment in which to evaluate |
quoted |
Is |
A minimal set of bindings to the OpenLayers javascript library, with a focus on polar mapping applications.
Maintainer: Ben Raymond [email protected]
Other contributors:
Stefan Kuethe [email protected] (Author of https://github.com/crazycapivara/openlayers/, of which polr is a reimplementation and extension (of a sort)) [contributor]
OpenLayers contributors (OpenLayers javascript library) [contributor]
Useful links:
Remove a layer
remove_layer(map, layer_name)remove_layer(map, layer_name)
map |
pol or pol_proxy: map to remove the layer from |
layer_name |
string: name of the layer. |
A pol map object