File tree Expand file tree Collapse file tree 7 files changed +19
-7
lines changed Expand file tree Collapse file tree 7 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 77- Add ` DistanceCalculatorInterface ` interface and three implementations:
88 ` HaversineDistanceCalculator ` , ` SphericalCosineDistanceCalculator ` and ` VincentyDistanceCalculator ` .
99- Add ` CoordinateUtils ` helper, to convert decimal coordinates (` 43.2109 ` ) in DMS (` 56° 78' 90" ` )
10-
11- - Add property ` $id ` to ` Marker ` , ` Polygon ` and ` Polyline ` constructors
10+ - Add parameter ` id ` to ` Marker ` , ` Polygon ` and ` Polyline ` constructors
1211- Add method ` Map::removeMarker(string|Marker $markerOrId) `
1312- Add method ` Map::removePolygon(string|Polygon $polygonOrId) `
1413- Add method ` Map::removePolyline(string|Polyline $polylineOrId) `
Original file line number Diff line number Diff line change 1111
1212namespace Symfony \UX \Map ;
1313
14+ /**
15+ * @author Sylvain Blondeau <contact@sylvainblondeau.dev>
16+ *
17+ * @internal
18+ */
1419interface Element
1520{
1621}
Original file line number Diff line number Diff line change 1515 * Represents a collection of map elements.
1616 *
1717 * @author Sylvain Blondeau <contact@sylvainblondeau.dev>
18+ *
19+ * @internal
1820 */
1921abstract class Elements
2022{
21- protected \SplObjectStorage $ elements ;
23+ private \SplObjectStorage $ elements ;
2224
2325 public function __construct (
2426 array $ elements ,
@@ -29,7 +31,7 @@ public function __construct(
2931 }
3032 }
3133
32- public function add (Element $ element ): self
34+ public function add (Element $ element ): static
3335 {
3436 $ this ->elements ->attach ($ element , $ element ->id ?? $ this ->elements ->getHash ($ element ));
3537
@@ -47,7 +49,7 @@ private function getElement(string $id): ?Element
4749 return null ;
4850 }
4951
50- public function remove (Element |string $ elementOrId ): self
52+ public function remove (Element |string $ elementOrId ): static
5153 {
5254 if (\is_string ($ elementOrId )) {
5355 $ elementOrId = $ this ->getElement ($ elementOrId );
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ final class Map
2626
2727 /**
2828 * @param Marker[] $markers
29+ * @param Polygon[] $polygons
2930 * @param Polyline[] $polylines
30- * @param Polygone[] $polygons
3131 */
3232 public function __construct (
3333 private readonly ?string $ rendererName = null ,
@@ -40,8 +40,8 @@ public function __construct(
4040 array $ polylines = [],
4141 ) {
4242 $ this ->markers = new Markers ($ markers );
43- $ this ->polylines = new Polylines ($ polylines );
4443 $ this ->polygons = new Polygons ($ polygons );
44+ $ this ->polylines = new Polylines ($ polylines );
4545 }
4646
4747 public function getRendererName (): ?string
Original file line number Diff line number Diff line change 1515 * Represents a Marker collection.
1616 *
1717 * @author Sylvain Blondeau <contact@sylvainblondeau.dev>
18+ *
19+ * @internal
1820 */
1921final class Markers extends Elements
2022{
Original file line number Diff line number Diff line change 1515 * Represents a Polygon collection.
1616 *
1717 * @author Sylvain Blondeau <contact@sylvainblondeau.dev>
18+ *
19+ * @internal
1820 */
1921final class Polygons extends Elements
2022{
Original file line number Diff line number Diff line change 1515 * Represents a Polyline collection.
1616 *
1717 * @author Sylvain Blondeau <contact@sylvainblondeau.dev>
18+ *
19+ * @internal
1820 */
1921final class Polylines extends Elements
2022{
You can’t perform that action at this time.
0 commit comments