You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #2547 [Map] markers, polygons and polylines removal (sblondeau, Kocal)
This PR was merged into the 2.x branch.
Discussion
----------
[Map] markers, polygons and polylines removal
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
Add new methods to remove markers, polygons or polylines (map elements)
Map elements will be store in SplObjectStorage instead of arrays.
When create a map element, you can now add an optional identfier (string).
New methods `getMarker(string identifier)`, `getPolygon(string identifier)` and `getPolyline(string $identifier)` car retreive a map element from its identfiier.
example
$departureMarker = new Marker (
position: new Point(45.7640, 4.8357),
title: 'Lyon',
identifier: 'departure'
)
$map->addMarker($departureMarker);
// remove marker with
$map->removeMarker($departureMarker)
// or
$map->removeMarker($map->getMarker('departure'));
Commits
-------
7f48247 [Map] Minor adjustements
a27bd08 allow marker, polygone and polyline removal
0 commit comments