-
Notifications
You must be signed in to change notification settings - Fork 507
/
Copy pathremove.Rd
103 lines (78 loc) · 2.49 KB
/
remove.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/controls.R, R/layers.R, R/plugin-measure.R,
% R/plugin-omnivore.R
\name{removeControl}
\alias{removeControl}
\alias{clearControls}
\alias{clearGroup}
\alias{removeImage}
\alias{clearImages}
\alias{remove}
\alias{removeTiles}
\alias{clearTiles}
\alias{removePopup}
\alias{clearPopups}
\alias{removeMarker}
\alias{clearMarkers}
\alias{removeMarkerCluster}
\alias{clearMarkerClusters}
\alias{removeMarkerFromCluster}
\alias{removeShape}
\alias{clearShapes}
\alias{removeGeoJSON}
\alias{clearGeoJSON}
\alias{removeMeasure}
\alias{removeTopoJSON}
\alias{clearTopoJSON}
\title{Remove elements from a map}
\usage{
removeControl(map, layerId)
clearControls(map)
clearGroup(map, group)
removeImage(map, layerId)
clearImages(map)
removeTiles(map, layerId)
clearTiles(map)
removePopup(map, layerId)
clearPopups(map)
removeMarker(map, layerId)
clearMarkers(map)
removeMarkerCluster(map, layerId)
clearMarkerClusters(map)
removeMarkerFromCluster(map, layerId, clusterId)
removeShape(map, layerId)
clearShapes(map)
removeGeoJSON(map, layerId)
clearGeoJSON(map)
removeMeasure(map)
removeTopoJSON(map, layerId)
clearTopoJSON(map)
}
\arguments{
\item{map}{a map widget object, possibly created from \code{\link[=leaflet]{leaflet()}}
but more likely from \code{\link[=leafletProxy]{leafletProxy()}}}
\item{layerId}{character vector; the layer id(s) of the item to remove}
\item{group}{the name of the group whose members should be removed}
\item{clusterId}{the id of the marker cluster layer}
}
\value{
the new \code{map} object
}
\description{
Remove one or more features from a map, identified by \code{layerId}; or,
clear all features of the given type or group.
}
\note{
When used with a \link[=leaflet]{leaflet} map object, these functions
don't actually remove the features from the map object, but simply add an
operation that will cause those features to be removed after they are
added. In other words, if you add a polygon \code{"foo"} and the call
\code{removeShape("foo")}, it's not smart enough to prevent the polygon
from being added in the first place; instead, when the map is rendered, the
polygon will be added and then removed.
For that reason, these functions aren't that useful with \code{leaflet} map
objects and are really intended to be used with \code{\link[=leafletProxy]{leafletProxy()}}
instead.
WMS tile layers are extensions of tile layers, so they can also be removed
or cleared via \code{removeTiles()} or \code{clearTiles()}.
}