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)
the leaflet map widget
a GeoJSON/TopoJSON URL or file contents in a character vector.
the layer id
the name of the group this raster image should belong to (see
the same parameter under addTiles
)
The type of marker. either 'marker' or 'circleMarker'
The property of the feature to use for marker icon.
Can be a JS function which accepts a feature and returns an index of markerIcons
.
In either case the result must be one of the indexes of markerIcons.
The options for markers
if not NULL
, markers will be clustered using
Leaflet.markercluster;
you can use markerClusterOptions()
to specify marker cluster
options
the id for the marker cluster layer
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.
A Vector of labelOptions
to provide label
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.
A Vector of popupOptions
to provide popups
whether to draw stroke along the path (e.g. the borders of polygons or circles)
stroke color
stroke width in pixels
stroke opacity (or layer opacity for tile layers)
whether to fill the path with color (e.g. filling on polygons or circles)
fill color
fill opacity
a string that defines the stroke dash pattern
how much to simplify the polyline on each zoom level (more means better performance and less accurate representation)
whether to disable polyline clipping
Options for shapes
Options for highlighting the shape on mouse over.
options for each label. Default NULL
you can use highlightOptions()
to specify highlight
options
An optional title for the legend
legend position
The numbers will be formatted using this locale
Options for formatting numbers
The property to use for coloring
The scale to use from chroma.js
number of breakes
q for quantile, e for equidistant, k for k-means
Default 'rgb', can be one of 'rgb', 'lab', 'hsl', 'lch'
either a single number or a 2 number vector for clipping color values at ends.
whether to correct lightness
whether to use bezier interpolate for determining colors
overrides scale with manual colors
Options to show a legend.
a KML URL or contents in a character vector.
field name for latitude
field name for longitude
field seperator
a CSV URL or contents in a character vector.
options for parsing the CSV.
Use csvParserOptions
() to supply csv parser options.
a GPX URL or contents in a character vector.