| addGeoJSONv2 {leaflet.extras} | R Documentation |
This is a feature rich alternative to the addGeoJSON & addTopoJSON
with options to map feature properties to labels, popups, colors, markers etc.
Options to customize a Choropleth Legend
Adds a GeoJSON/TopoJSON Choropleth.
Adds a KML to the leaflet map.
Adds a KML Choropleth.
Options for parsing CSV
Adds a CSV to the leaflet map.
Adds a GPX to the leaflet map.
addGeoJSONv2(map, geojson, layerId = NULL, group = NULL,
markerType = NULL, markerIcons = NULL, markerIconProperty = NULL,
markerOptions = leaflet::markerOptions(), clusterOptions = NULL,
clusterId = NULL, labelProperty = NULL,
labelOptions = leaflet::labelOptions(), popupProperty = NULL,
popupOptions = leaflet::popupOptions(), stroke = TRUE, color = "#03F",
weight = 5, opacity = 0.5, fill = TRUE, fillColor = color,
fillOpacity = 0.2, dashArray = NULL, smoothFactor = 1, noClip = FALSE,
pathOptions = leaflet::pathOptions(), highlightOptions = NULL)
legendOptions(title = NULL, position = c("bottomleft", "bottomright",
"topleft", "topright"), locale = "en-US", numberFormatOptions = list(style
= "decimal", maximumFractionDigits = 2))
addGeoJSONChoropleth(map, geojson, layerId = NULL, group = NULL,
valueProperty, labelProperty = NULL,
labelOptions = leaflet::labelOptions(), popupProperty = NULL,
popupOptions = leaflet::popupOptions(), scale = c("white", "red"),
steps = 5, mode = "q", channelMode = c("rgb", "lab", "hsl", "lch"),
padding = NULL, correctLightness = FALSE, bezierInterpolate = FALSE,
colors = NULL, stroke = TRUE, color = "#03F", weight = 1,
opacity = 0.5, fillOpacity = 0.2, dashArray = NULL, smoothFactor = 1,
noClip = FALSE, pathOptions = leaflet::pathOptions(),
highlightOptions = NULL, legendOptions = NULL)
addKML(map, kml, layerId = NULL, group = NULL, markerType = NULL,
markerIcons = NULL, markerIconProperty = NULL,
markerOptions = leaflet::markerOptions(), clusterOptions = NULL,
clusterId = NULL, labelProperty = NULL,
labelOptions = leaflet::labelOptions(), popupProperty = NULL,
popupOptions = leaflet::popupOptions(), stroke = TRUE, color = "#03F",
weight = 5, opacity = 0.5, fill = TRUE, fillColor = color,
fillOpacity = 0.2, dashArray = NULL, smoothFactor = 1, noClip = FALSE,
pathOptions = leaflet::pathOptions(), highlightOptions = NULL)
addKMLChoropleth(map, kml, layerId = NULL, group = NULL, valueProperty,
labelProperty = NULL, labelOptions = leaflet::labelOptions(),
popupProperty = NULL, popupOptions = leaflet::popupOptions(),
scale = c("white", "red"), steps = 5, mode = "q",
channelMode = c("rgb", "lab", "hsl", "lch"), padding = NULL,
correctLightness = FALSE, bezierInterpolate = FALSE, colors = NULL,
stroke = TRUE, color = "#03F", weight = 1, opacity = 0.5,
fillOpacity = 0.2, dashArray = NULL, smoothFactor = 1, noClip = FALSE,
pathOptions = leaflet::pathOptions(), highlightOptions = NULL,
legendOptions = NULL)
csvParserOptions(latfield, lonfield, delimiter = ",")
addCSV(map, csv, csvParserOptions, layerId = NULL, group = NULL,
markerType = NULL, markerIcons = NULL, markerIconProperty = NULL,
markerOptions = leaflet::markerOptions(), clusterOptions = NULL,
clusterId = NULL, labelProperty = NULL,
labelOptions = leaflet::labelOptions(), popupProperty = NULL,
popupOptions = leaflet::popupOptions(), stroke = TRUE, color = "#03F",
weight = 5, opacity = 0.5, fill = TRUE, fillColor = color,
fillOpacity = 0.2, dashArray = NULL, smoothFactor = 1, noClip = FALSE,
pathOptions = leaflet::pathOptions(), highlightOptions = NULL)
addGPX(map, gpx, layerId = NULL, group = NULL, markerType = NULL,
markerIcons = NULL, markerIconProperty = NULL,
markerOptions = leaflet::markerOptions(), clusterOptions = NULL,
clusterId = NULL, labelProperty = NULL,
labelOptions = leaflet::labelOptions(), popupProperty = NULL,
popupOptions = leaflet::popupOptions(), stroke = TRUE, color = "#03F",
weight = 5, opacity = 0.5, fill = TRUE, fillColor = color,
fillOpacity = 0.2, dashArray = NULL, smoothFactor = 1, noClip = FALSE,
pathOptions = leaflet::pathOptions(), highlightOptions = NULL)
map |
the leaflet map widget |
geojson |
a GeoJSON/TopoJSON URL or file contents in a character vector. |
layerId |
the layer id |
group |
the name of the group this raster image should belong to (see
the same parameter under |
markerType |
The type of marker. either 'marker' or 'circleMarker' |
markerIcons |
Icons for Marker.
Can be a single marker using |
markerIconProperty |
The property of the feature to use for marker icon.
Can be a JS function which accepts a feature and returns an index of |
markerOptions |
The options for markers |
clusterOptions |
if not |
clusterId |
the id for the marker cluster layer |
labelProperty |
The property to use for the label. You can also pass in a JS function that takes in a feature and returns a text/HTML content. |
labelOptions |
A Vector of |
popupProperty |
The property to use for popup content You can also pass in a JS function that takes in a feature and returns a text/HTML content. |
popupOptions |
A Vector of |
stroke |
whether to draw stroke along the path (e.g. the borders of polygons or circles) |
color |
stroke color |
weight |
stroke width in pixels |
opacity |
stroke opacity (or layer opacity for tile layers) |
fill |
whether to fill the path with color (e.g. filling on polygons or circles) |
fillColor |
fill color |
fillOpacity |
fill opacity |
dashArray |
a string that defines the stroke dash pattern |
smoothFactor |
how much to simplify the polyline on each zoom level (more means better performance and less accurate representation) |
noClip |
whether to disable polyline clipping |
pathOptions |
Options for shapes |
highlightOptions |
Options for highlighting the shape on mouse over.
options for each label. Default |
title |
An optional title for the legend |
position |
legend position |
locale |
The numbers will be formatted using this locale |
numberFormatOptions |
Options for formatting numbers |
valueProperty |
The property to use for coloring |
scale |
The scale to use from chroma.js |
steps |
number of breakes |
mode |
q for quantile, e for equidistant, k for k-means |
channelMode |
Default 'rgb', can be one of 'rgb', 'lab', 'hsl', 'lch' |
padding |
either a single number or a 2 number vector for clipping color values at ends. |
correctLightness |
whether to correct lightness |
bezierInterpolate |
whether to use bezier interpolate for determining colors |
colors |
overrides scale with manual colors |
legendOptions |
Options to show a legend. |
kml |
a KML URL or contents in a character vector. |
latfield |
field name for latitude |
lonfield |
field name for longitude |
delimiter |
field seperator |
csv |
a CSV URL or contents in a character vector. |
csvParserOptions |
options for parsing the CSV.
Use |
gpx |
a GPX URL or contents in a character vector. |