@@ -136,10 +136,37 @@ You can add markers to a map using the ``addMarker()`` method::
136
136
))
137
137
;
138
138
139
+ Remove elements from Map
140
+ ~~~~~~~~~~~~~~~~~~~~~~~~
141
+
142
+ It is possible to remove elements like ``Marker ``, ``Polygon `` and ``Polyline `` instances by using methods ``Map::remove*() ``:
143
+ // Add elements
144
+ $map->addMarker($marker = new Marker(/* ... */));
145
+ $map->addPolygon($polygon = new Polygon(/ * ... */));
146
+ $map->addPolyline($polyline = new Polyline(/ * ... */));
147
+
148
+ // And later, remove those elements
149
+ $map->removeMarker($marker);
150
+ $map->removePolygon($polygon);
151
+ $map->removePolyline($polyline);
152
+
153
+ If unfortunately you were unable to store an element instance, you can still remove them by passing the identifier string:
154
+
155
+ $map = new Map(/* ... */);
156
+ // Add elements
157
+ $map->addMarker(new Marker(id: 'my-marker', / * ... */));
158
+ $map->addPolygon(new Polygon(id: 'my-polygon', / * ... */));
159
+ $map->addPolyline(new Polyline(id: 'my-marker', / * ... */));
160
+
161
+ // And later, remove those elements
162
+ $map->removeMarker('my-marker');
163
+ $map->removePolygon('my-polygon');
164
+ $map->removePolyline('my-marker');
165
+
139
166
Add Polygons
140
167
~~~~~~~~~~~~
141
168
142
- You can also add Polygons, which represents an area enclosed by a series of ``Point `` instances::
169
+ You can also add Polygons, which represents an area enclosed by a series of ``Point `` instances:
143
170
144
171
$myMap->addPolygon(new Polygon(
145
172
points: [
@@ -156,7 +183,7 @@ You can also add Polygons, which represents an area enclosed by a series of ``Po
156
183
Add Polylines
157
184
~~~~~~~~~~~~~
158
185
159
- You can add Polylines, which represents a path made by a series of ``Point `` instances::
186
+ You can add Polylines, which represents a path made by a series of ``Point `` instances:
160
187
161
188
$myMap->addPolyline(new Polyline(
162
189
points: [
0 commit comments