diff --git a/package.json b/package.json index 8fb3303b5a0..aa1982ef096 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,5 @@ "tinyglobby": "^0.2.14", "tsup": "^8.5.0", "vitest": "^3.2.4" - }, - "version": "2.27.0" + } } diff --git a/src/Map/CHANGELOG.md b/src/Map/CHANGELOG.md index 0dcbae589fe..fdd7bf21505 100644 --- a/src/Map/CHANGELOG.md +++ b/src/Map/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 2.30 + +- Deprecate option `title` from `Polygon`, `Polyline`, `Rectangle` and `Circle` in favor of `infoWindow` + ## 2.29.0 - Add Symfony 8 support diff --git a/src/Map/assets/src/abstract_map_controller.ts b/src/Map/assets/src/abstract_map_controller.ts index f2faaef473a..46932827344 100644 --- a/src/Map/assets/src/abstract_map_controller.ts +++ b/src/Map/assets/src/abstract_map_controller.ts @@ -65,7 +65,7 @@ export type MarkerDefinition = Wit infoWindow?: Omit, 'position'>; icon?: Icon; /** - * @deprecated Use "bridgeOptions" instead. + * @deprecated since Symfony UX Map 2.27, use "bridgeOptions" instead. * Raw options passed to the marker constructor, specific to the map provider (e.g.: `L.marker()` for Leaflet). */ rawOptions?: BridgeMarkerOptions; @@ -86,9 +86,12 @@ export type MarkerDefinition = Wit export type PolygonDefinition = WithIdentifier<{ infoWindow?: Omit, 'position'>; points: Array | Array>; + /** + * @deprecated since Symfony UX Map 2.29, use "infoWindow" instead + */ title: string | null; /** - * @deprecated Use "bridgeOptions" instead. + * @deprecated since Symfony UX Map 2.27, use "bridgeOptions" instead. * Raw options passed to the polygon constructor, specific to the map provider (e.g.: `L.polygon()` for Leaflet). */ rawOptions?: BridgePolygonOptions; @@ -109,9 +112,12 @@ export type PolygonDefinition = W export type PolylineDefinition = WithIdentifier<{ infoWindow?: Omit, 'position'>; points: Array; + /** + * @deprecated since Symfony UX Map 2.29, use "infoWindow" instead + */ title: string | null; /** - * @deprecated Use "bridgeOptions" instead. + * @deprecated since Symfony UX Map 2.27, use "bridgeOptions" instead. * Raw options passed to the polyline constructor, specific to the map provider (e.g.: `L.polyline()` for Leaflet). */ rawOptions?: BridgePolylineOptions; @@ -133,9 +139,12 @@ export type CircleDefinition = Wit infoWindow?: Omit, 'position'>; center: Point; radius: number; + /** + * @deprecated since Symfony UX Map 2.29, use "infoWindow" instead + */ title: string | null; /** - * @deprecated Use "bridgeOptions" instead. + * @deprecated since Symfony UX Map 2.27, use "bridgeOptions" instead. * Raw options passed to the circle constructor, specific to the map provider (e.g.: `L.circle()` for Leaflet). */ rawOptions?: BridgeCircleOptions; @@ -157,9 +166,12 @@ export type RectangleDefinition infoWindow?: Omit, 'position'>; southWest: Point; northEast: Point; + /** + * @deprecated since Symfony UX Map 2.29, use "infoWindow" instead + */ title: string | null; /** - * @deprecated Use "bridgeOptions" instead. + * @deprecated since Symfony UX Map 2.27, use "bridgeOptions" instead. * Raw options passed to the rectangle constructor, specific to the map provider (e.g.: `L.rectangle()` for Leaflet). */ rawOptions?: BridgeRectangleOptions; @@ -184,7 +196,7 @@ export type InfoWindowDefinition = { opened: boolean; autoClose: boolean; /** - * @deprecated Use "bridgeOptions" instead. + * @deprecated since Symfony UX Map 2.27, use "bridgeOptions" instead. * Raw options passed to the info window constructor, specific to the map provider (e.g.: `google.maps.InfoWindow()` for Google Maps). */ rawOptions?: BridgeInfoWindowOptions; diff --git a/src/Map/doc/index.rst b/src/Map/doc/index.rst index 79dda97fa87..4bd2ecdd0c7 100644 --- a/src/Map/doc/index.rst +++ b/src/Map/doc/index.rst @@ -237,7 +237,6 @@ You can add Circles, which represents a circular area defined by a center point $map->addCircle(new Circle( center: new Point(48.8566, 2.3522), radius: 5_000, // 5km - title: 'Paris', infoWindow: new InfoWindow( content: 'A 5km radius circle centered on Paris', ), @@ -251,7 +250,6 @@ You can add Rectangles, which represents a rectangular area defined by two corne $map->addRectangle(new Rectangle( southWest: new Point(48.8566, 2.3522), // Paris northEast: new Point(50.6292, 3.0573), // Lille - title: 'Paris to Lille', infoWindow: new InfoWindow( content: 'A rectangle from Paris to Lille', ), @@ -504,7 +502,7 @@ Symfony UX Map allows you to extend its default behavior using a custom Stimulus */ _onPolygonBeforeCreate(event) { console.log(event.detail.definition); - // { title: 'My polygon', points: [ { lat: 48.8566, lng: 2.3522 }, { lat: 45.7640, lng: 4.8357 }, { lat: 43.2965, lng: 5.3698 }, ... ], ... } + // { points: [ { lat: 48.8566, lng: 2.3522 }, { lat: 45.7640, lng: 4.8357 }, { lat: 43.2965, lng: 5.3698 }, ... ], ... } } /** @@ -522,7 +520,7 @@ Symfony UX Map allows you to extend its default behavior using a custom Stimulus */ _onPolylineBeforeCreate(event) { console.log(event.detail.definition); - // { title: 'My polyline', points: [ { lat: 48.8566, lng: 2.3522 }, { lat: 45.7640, lng: 4.8357 }, { lat: 43.2965, lng: 5.3698 }, ... ], ... } + // { points: [ { lat: 48.8566, lng: 2.3522 }, { lat: 45.7640, lng: 4.8357 }, { lat: 43.2965, lng: 5.3698 }, ... ], ... } } /** @@ -536,7 +534,7 @@ Symfony UX Map allows you to extend its default behavior using a custom Stimulus _onCircleBeforeCreate(event) { console.log(event.detail.definition); - // { title: 'My circle', center: { lat: 48.8566, lng: 2.3522 }, radius: 1000, ... } + // { center: { lat: 48.8566, lng: 2.3522 }, radius: 1000, ... } } _onCircleAfterCreate(event) { @@ -546,7 +544,7 @@ Symfony UX Map allows you to extend its default behavior using a custom Stimulus _onRectangleBeforeCreate(event) { console.log(event.detail.definition); - // { title: 'My rectangle', southWest: { lat: 48.8566, lng: 2.3522 }, northEast: { lat: 45.7640, lng: 4.8357 }, ... } + // { southWest: { lat: 48.8566, lng: 2.3522 }, northEast: { lat: 45.7640, lng: 4.8357 }, ... } } _onRectangleAfterCreate(event) { diff --git a/src/Map/src/Bridge/Google/assets/src/map_controller.ts b/src/Map/src/Bridge/Google/assets/src/map_controller.ts index b92fca4714b..b03a35fc553 100644 --- a/src/Map/src/Bridge/Google/assets/src/map_controller.ts +++ b/src/Map/src/Bridge/Google/assets/src/map_controller.ts @@ -212,6 +212,9 @@ export default class extends AbstractMapController< ...bridgeOptions, }); + /** + * @deprecated since Symfony UX Map 2.29, will be removed in 3.0 + */ if (title) { polygon.set('title', title); } @@ -241,6 +244,9 @@ export default class extends AbstractMapController< ...bridgeOptions, }); + /** + * @deprecated since Symfony UX Map 2.29, will be removed in 3.0 + */ if (title) { polyline.set('title', title); } @@ -267,6 +273,9 @@ export default class extends AbstractMapController< ...bridgeOptions, }); + /** + * @deprecated since Symfony UX Map 2.29, will be removed in 3.0 + */ if (title) { circle.set('title', title); } @@ -296,6 +305,9 @@ export default class extends AbstractMapController< ...bridgeOptions, }); + /** + * @deprecated since Symfony UX Map 2.29, will be removed in 3.0 + */ if (title) { rectangle.set('title', title); } diff --git a/src/Map/src/Bridge/Leaflet/assets/src/map_controller.ts b/src/Map/src/Bridge/Leaflet/assets/src/map_controller.ts index 42f55665d17..52efd4405b3 100644 --- a/src/Map/src/Bridge/Leaflet/assets/src/map_controller.ts +++ b/src/Map/src/Bridge/Leaflet/assets/src/map_controller.ts @@ -169,6 +169,9 @@ export default class extends AbstractMapController< const polygon = L.polygon(points, { ...rawOptions, ...bridgeOptions }).addTo(this.map); + /** + * @deprecated since Symfony UX Map 2.29 + */ if (title) { polygon.bindPopup(title); } @@ -189,6 +192,9 @@ export default class extends AbstractMapController< const polyline = L.polyline(points, { ...rawOptions, ...bridgeOptions }).addTo(this.map); + /** + * @deprecated since Symfony UX Map 2.29 + */ if (title) { polyline.bindPopup(title); } @@ -209,6 +215,9 @@ export default class extends AbstractMapController< const circle = L.circle(center, { radius, ...rawOptions, ...bridgeOptions }).addTo(this.map); + /** + * @deprecated since Symfony UX Map 2.29 + */ if (title) { circle.bindPopup(title); } @@ -235,6 +244,9 @@ export default class extends AbstractMapController< { ...rawOptions, ...bridgeOptions } ).addTo(this.map); + /** + * @deprecated since Symfony UX Map 2.29 + */ if (title) { rectangle.bindPopup(title); } diff --git a/src/Map/src/Bridge/Leaflet/tests/LeafletRendererTest.php b/src/Map/src/Bridge/Leaflet/tests/LeafletRendererTest.php index 5af905856af..8636773a181 100644 --- a/src/Map/src/Bridge/Leaflet/tests/LeafletRendererTest.php +++ b/src/Map/src/Bridge/Leaflet/tests/LeafletRendererTest.php @@ -103,7 +103,7 @@ public static function provideTestRenderMap(): iterable 'map' => (new Map()) ->center(new Point(48.8566, 2.3522)) ->zoom(12) - ->addCircle(new Circle(center: new Point(48.8566, 2.3522), radius: 1000000, title: 'Paris', id: 'circle1')) + ->addCircle(new Circle(center: new Point(48.8566, 2.3522), radius: 1000000, id: 'circle1')) ->addCircle(new Circle(center: new Point(1.1, 2.2), radius: 500, infoWindow: new InfoWindow(content: 'Circle'), id: 'circle2')), ]; @@ -115,7 +115,6 @@ public static function provideTestRenderMap(): iterable ->addRectangle(new Rectangle( southWest: new Point(48.8566, 2.3522), northEast: new Point(48.8566, 2.3522), - title: 'Rectangle', id: 'rectangle1' )) ->addRectangle(new Rectangle( diff --git a/src/Map/src/Bridge/Leaflet/tests/__snapshots__/LeafletRendererTest__testRenderMap with data set with circles and infoWindows__1.txt b/src/Map/src/Bridge/Leaflet/tests/__snapshots__/LeafletRendererTest__testRenderMap with data set with circles and infoWindows__1.txt index e6bbccceadd..e473b116a21 100644 --- a/src/Map/src/Bridge/Leaflet/tests/__snapshots__/LeafletRendererTest__testRenderMap with data set with circles and infoWindows__1.txt +++ b/src/Map/src/Bridge/Leaflet/tests/__snapshots__/LeafletRendererTest__testRenderMap with data set with circles and infoWindows__1.txt @@ -10,6 +10,6 @@ data-symfony--ux-leaflet-map--map-markers-value="[]" data-symfony--ux-leaflet-map--map-polygons-value="[]" data-symfony--ux-leaflet-map--map-polylines-value="[]" - data-symfony--ux-leaflet-map--map-circles-value="[{"center":{"lat":48.8566,"lng":2.3522},"radius":1000000,"title":"Paris","infoWindow":null,"extra":[],"id":"circle1","@id":"b12929e5dc57d558"},{"center":{"lat":1.1,"lng":2.2},"radius":500,"title":null,"infoWindow":{"headerContent":null,"content":"Circle","position":null,"opened":false,"autoClose":true,"extra":[]},"extra":[],"id":"circle2","@id":"4953b5cc1d5759f4"}]" + data-symfony--ux-leaflet-map--map-circles-value="[{"center":{"lat":48.8566,"lng":2.3522},"radius":1000000,"title":null,"infoWindow":null,"extra":[],"id":"circle1","@id":"ead7389af3a04828"},{"center":{"lat":1.1,"lng":2.2},"radius":500,"title":null,"infoWindow":{"headerContent":null,"content":"Circle","position":null,"opened":false,"autoClose":true,"extra":[]},"extra":[],"id":"circle2","@id":"4953b5cc1d5759f4"}]" data-symfony--ux-leaflet-map--map-rectangles-value="[]" > \ No newline at end of file diff --git a/src/Map/src/Bridge/Leaflet/tests/__snapshots__/LeafletRendererTest__testRenderMap with data set with rectangles and infoWindows__1.txt b/src/Map/src/Bridge/Leaflet/tests/__snapshots__/LeafletRendererTest__testRenderMap with data set with rectangles and infoWindows__1.txt index b85e1a42630..7375a4397fd 100644 --- a/src/Map/src/Bridge/Leaflet/tests/__snapshots__/LeafletRendererTest__testRenderMap with data set with rectangles and infoWindows__1.txt +++ b/src/Map/src/Bridge/Leaflet/tests/__snapshots__/LeafletRendererTest__testRenderMap with data set with rectangles and infoWindows__1.txt @@ -11,5 +11,5 @@ data-symfony--ux-leaflet-map--map-polygons-value="[]" data-symfony--ux-leaflet-map--map-polylines-value="[]" data-symfony--ux-leaflet-map--map-circles-value="[]" - data-symfony--ux-leaflet-map--map-rectangles-value="[{"southWest":{"lat":48.8566,"lng":2.3522},"northEast":{"lat":48.8566,"lng":2.3522},"title":"Rectangle","infoWindow":null,"extra":[],"id":"rectangle1","@id":"4cde1a021a127686"},{"southWest":{"lat":1.1,"lng":2.2},"northEast":{"lat":3.3,"lng":4.4},"title":null,"infoWindow":{"headerContent":null,"content":"Rectangle","position":null,"opened":false,"autoClose":true,"extra":[]},"extra":[],"id":"rectangle2","@id":"2549f5a73ef6bee7"}]" + data-symfony--ux-leaflet-map--map-rectangles-value="[{"southWest":{"lat":48.8566,"lng":2.3522},"northEast":{"lat":48.8566,"lng":2.3522},"title":null,"infoWindow":null,"extra":[],"id":"rectangle1","@id":"2ee3f2ebdef84b13"},{"southWest":{"lat":1.1,"lng":2.2},"northEast":{"lat":3.3,"lng":4.4},"title":null,"infoWindow":{"headerContent":null,"content":"Rectangle","position":null,"opened":false,"autoClose":true,"extra":[]},"extra":[],"id":"rectangle2","@id":"2549f5a73ef6bee7"}]" > \ No newline at end of file diff --git a/src/Map/src/Circle.php b/src/Map/src/Circle.php index 711f4a24565..76844a5dfae 100644 --- a/src/Map/src/Circle.php +++ b/src/Map/src/Circle.php @@ -34,6 +34,10 @@ public function __construct( public readonly array $extra = [], public readonly ?string $id = null, ) { + if (null !== $title) { + trigger_deprecation('symfony/ux-map', '2.30', 'The "title" parameter is deprecated and will be removed in 3.0. Use "infoWindow" instead.'); + } + if ($radius <= 0) { throw new InvalidArgumentException(\sprintf('Radius must be greater than 0, "%s" given.', $radius)); } diff --git a/src/Map/src/Polygon.php b/src/Map/src/Polygon.php index 180c7e13033..068be69eb35 100644 --- a/src/Map/src/Polygon.php +++ b/src/Map/src/Polygon.php @@ -33,6 +33,9 @@ public function __construct( private readonly array $extra = [], public readonly ?string $id = null, ) { + if (null !== $title) { + trigger_deprecation('symfony/ux-map', '2.30', 'The "title" parameter is deprecated and will be removed in 3.0. Use "infoWindow" instead.'); + } } /** diff --git a/src/Map/src/Polyline.php b/src/Map/src/Polyline.php index 4279456e753..33ba0375d8c 100644 --- a/src/Map/src/Polyline.php +++ b/src/Map/src/Polyline.php @@ -32,6 +32,9 @@ public function __construct( private readonly array $extra = [], public readonly ?string $id = null, ) { + if (null !== $title) { + trigger_deprecation('symfony/ux-map', '2.30', 'The "title" parameter is deprecated and will be removed in 3.0. Use "infoWindow" instead.'); + } } /** diff --git a/src/Map/src/Rectangle.php b/src/Map/src/Rectangle.php index 71479495e75..7212d4af028 100644 --- a/src/Map/src/Rectangle.php +++ b/src/Map/src/Rectangle.php @@ -33,6 +33,9 @@ public function __construct( public readonly array $extra = [], public readonly ?string $id = null, ) { + if (null !== $title) { + trigger_deprecation('symfony/ux-map', '2.30', 'The "title" parameter is deprecated and will be removed in 3.0. Use "infoWindow" instead.'); + } } /** diff --git a/src/Map/tests/CircleTest.php b/src/Map/tests/CircleTest.php index 8d853a5b248..21753783480 100644 --- a/src/Map/tests/CircleTest.php +++ b/src/Map/tests/CircleTest.php @@ -27,7 +27,6 @@ public function testToArray() $circle = new Circle( center: $center, radius: 500, - title: 'Test Circle', infoWindow: $infoWindow, extra: ['foo' => 'bar'], id: 'circle1' @@ -37,7 +36,7 @@ public function testToArray() self::assertSame([ 'center' => ['lat' => 1.1, 'lng' => 2.2], 'radius' => 500.0, - 'title' => 'Test Circle', + 'title' => null, 'infoWindow' => [ 'headerContent' => 'info content', 'content' => null, @@ -56,7 +55,7 @@ public function testFromArray() $data = [ 'center' => ['lat' => 1.1, 'lng' => 2.2], 'radius' => 500, - 'title' => 'Test Circle', + 'title' => null, 'infoWindow' => ['content' => 'info content'], 'extra' => ['foo' => 'bar'], 'id' => 'circle1', @@ -70,7 +69,7 @@ public function testFromArray() self::assertSame([ 'center' => ['lat' => 1.1, 'lng' => 2.2], 'radius' => 500.0, - 'title' => 'Test Circle', + 'title' => null, 'infoWindow' => [ 'headerContent' => null, 'content' => 'info content', diff --git a/src/Map/tests/MapFactoryTest.php b/src/Map/tests/MapFactoryTest.php index 834c4f506dc..726360e8316 100644 --- a/src/Map/tests/MapFactoryTest.php +++ b/src/Map/tests/MapFactoryTest.php @@ -85,7 +85,6 @@ public function testToArrayFromArray() new Point(48.853, 2.3499), new Point(48.8566, 2.3522), ], - title: 'Polygon 1', infoWindow: new InfoWindow('Polygon 1', 'Polygon 1', extra: ['color' => 'red']), extra: ['color' => 'blue'], )); @@ -222,7 +221,7 @@ private static function createMapArray(): array 'lng' => 2.3522, ], ], - 'title' => 'Polygon 1', + 'title' => null, 'infoWindow' => [ 'headerContent' => 'Polygon 1', 'content' => 'Polygon 1', @@ -245,7 +244,7 @@ private static function createMapArray(): array 'lng' => 2.3522, ], ], - 'title' => 'Polyline 1', + 'title' => null, 'infoWindow' => [ 'headerContent' => 'Polyline 1', 'content' => 'Polyline 1', diff --git a/src/Map/tests/MapTest.php b/src/Map/tests/MapTest.php index f88cec82630..c5ed272faa2 100644 --- a/src/Map/tests/MapTest.php +++ b/src/Map/tests/MapTest.php @@ -135,7 +135,6 @@ public function testWithMaximumConfiguration() new Point(48.853, 2.3499), new Point(48.8566, 2.3522), ], - title: 'Polygon 1', infoWindow: null, )) ->addPolygon(new Polygon( @@ -144,7 +143,6 @@ public function testWithMaximumConfiguration() new Point(45.75, 4.85), new Point(45.77, 4.82), ], - title: 'Polygon 2', infoWindow: new InfoWindow( headerContent: 'Polygon 2', content: 'A polygon around Lyon with some additional info.', @@ -159,7 +157,6 @@ public function testWithMaximumConfiguration() new Point(48.853, 2.3499), new Point(48.8566, 2.3522), ], - title: 'Polyline 1', infoWindow: null, )) ->addPolyline(new Polyline( @@ -168,7 +165,6 @@ public function testWithMaximumConfiguration() new Point(45.75, 4.85), new Point(45.77, 4.82), ], - title: 'Polyline 2', infoWindow: new InfoWindow( headerContent: 'Polyline 2', content: 'A polyline around Lyon with some additional info.', @@ -180,7 +176,6 @@ public function testWithMaximumConfiguration() ->addCircle(new Circle( center: new Point(48.8566, 2.3522), radius: 500, - title: 'Circle around Paris', infoWindow: new InfoWindow( headerContent: 'Circle around Paris', content: 'A circle with a radius of 500 meters around Paris.', @@ -192,7 +187,6 @@ public function testWithMaximumConfiguration() ->addCircle(new Circle( center: new Point(45.764, 4.8357), radius: 300, - title: 'Circle around Lyon', infoWindow: new InfoWindow( headerContent: 'Circle around Lyon', content: 'A circle with a radius of 300 meters around Lyon.', @@ -204,7 +198,6 @@ public function testWithMaximumConfiguration() ->addRectangle(new Rectangle( southWest: new Point(48.853, 2.3499), northEast: new Point(48.8566, 2.3522), - title: 'Rectangle around Paris', infoWindow: new InfoWindow( headerContent: 'Rectangle around Paris', content: 'A rectangle around Paris.', @@ -216,7 +209,6 @@ public function testWithMaximumConfiguration() ->addRectangle(new Rectangle( southWest: new Point(45.75, 4.85), northEast: new Point(45.77, 4.82), - title: 'Rectangle around Lyon', infoWindow: new InfoWindow( headerContent: 'Rectangle around Lyon', content: 'A rectangle around Lyon.', @@ -297,7 +289,7 @@ public function testWithMaximumConfiguration() ['lat' => 48.853, 'lng' => 2.3499], ['lat' => 48.8566, 'lng' => 2.3522], ], - 'title' => 'Polygon 1', + 'title' => null, 'infoWindow' => null, 'extra' => [], 'id' => null, @@ -308,7 +300,7 @@ public function testWithMaximumConfiguration() ['lat' => 45.75, 'lng' => 4.85], ['lat' => 45.77, 'lng' => 4.82], ], - 'title' => 'Polygon 2', + 'title' => null, 'infoWindow' => [ 'headerContent' => 'Polygon 2', 'content' => 'A polygon around Lyon with some additional info.', @@ -328,7 +320,7 @@ public function testWithMaximumConfiguration() ['lat' => 48.853, 'lng' => 2.3499], ['lat' => 48.8566, 'lng' => 2.3522], ], - 'title' => 'Polyline 1', + 'title' => null, 'infoWindow' => null, 'extra' => [], 'id' => null, @@ -339,7 +331,7 @@ public function testWithMaximumConfiguration() ['lat' => 45.75, 'lng' => 4.85], ['lat' => 45.77, 'lng' => 4.82], ], - 'title' => 'Polyline 2', + 'title' => null, 'infoWindow' => [ 'headerContent' => 'Polyline 2', 'content' => 'A polyline around Lyon with some additional info.', @@ -356,7 +348,7 @@ public function testWithMaximumConfiguration() [ 'center' => ['lat' => 48.8566, 'lng' => 2.3522], 'radius' => 500, - 'title' => 'Circle around Paris', + 'title' => null, 'infoWindow' => [ 'headerContent' => 'Circle around Paris', 'content' => 'A circle with a radius of 500 meters around Paris.', @@ -371,7 +363,7 @@ public function testWithMaximumConfiguration() [ 'center' => ['lat' => 45.764, 'lng' => 4.8357], 'radius' => 300, - 'title' => 'Circle around Lyon', + 'title' => null, 'infoWindow' => [ 'headerContent' => 'Circle around Lyon', 'content' => 'A circle with a radius of 300 meters around Lyon.', @@ -388,7 +380,7 @@ public function testWithMaximumConfiguration() [ 'southWest' => ['lat' => 48.853, 'lng' => 2.3499], 'northEast' => ['lat' => 48.8566, 'lng' => 2.3522], - 'title' => 'Rectangle around Paris', + 'title' => null, 'infoWindow' => [ 'headerContent' => 'Rectangle around Paris', 'content' => 'A rectangle around Paris.', @@ -403,7 +395,7 @@ public function testWithMaximumConfiguration() [ 'southWest' => ['lat' => 45.75, 'lng' => 4.85], 'northEast' => ['lat' => 45.77, 'lng' => 4.82], - 'title' => 'Rectangle around Lyon', + 'title' => null, 'infoWindow' => [ 'headerContent' => 'Rectangle around Lyon', 'content' => 'A rectangle around Lyon.', diff --git a/src/Map/tests/PolygonTest.php b/src/Map/tests/PolygonTest.php index ccd9755ff13..88d81475bfc 100644 --- a/src/Map/tests/PolygonTest.php +++ b/src/Map/tests/PolygonTest.php @@ -28,7 +28,6 @@ public function testToArray() $polygon = new Polygon( points: [$point1, $point2], - title: 'Test Polygon', infoWindow: $infoWindow, extra: ['foo' => 'bar'], id: 'poly1' @@ -37,7 +36,7 @@ public function testToArray() $array = $polygon->toArray(); $this->assertSame([ 'points' => [['lat' => 1.1, 'lng' => 2.2], ['lat' => 3.3, 'lng' => 4.4]], - 'title' => 'Test Polygon', + 'title' => null, 'infoWindow' => [ 'headerContent' => 'info content', 'content' => null, @@ -80,7 +79,6 @@ public function testFromArray() 'points' => [ ['lat' => 1.1, 'lng' => 2.2], ['lat' => 3.3, 'lng' => 4.4], ], - 'title' => 'Test Polygon', 'infoWindow' => ['content' => 'info content'], 'extra' => ['foo' => 'bar'], 'id' => 'poly1', @@ -93,7 +91,7 @@ public function testFromArray() $array = $polygon->toArray(); $this->assertSame([ 'points' => [['lat' => 1.1, 'lng' => 2.2], ['lat' => 3.3, 'lng' => 4.4]], - 'title' => 'Test Polygon', + 'title' => null, 'infoWindow' => [ 'headerContent' => null, 'content' => 'info content', @@ -114,7 +112,6 @@ public function testFromArrayMultidimensional() [['lat' => 1.1, 'lng' => 2.2], ['lat' => 3.3, 'lng' => 4.4]], [['lat' => 5.5, 'lng' => 6.6]], ], - 'title' => 'Test Polygon', 'infoWindow' => ['content' => 'info content'], 'extra' => ['foo' => 'bar'], 'id' => 'poly1', @@ -130,7 +127,7 @@ public function testFromArrayMultidimensional() [['lat' => 1.1, 'lng' => 2.2], ['lat' => 3.3, 'lng' => 4.4]], [['lat' => 5.5, 'lng' => 6.6]], ], - 'title' => 'Test Polygon', + 'title' => null, 'infoWindow' => [ 'headerContent' => null, 'content' => 'info content', diff --git a/src/Map/tests/RectangleTest.php b/src/Map/tests/RectangleTest.php index 60517f8bfc6..d4c3a2a2234 100644 --- a/src/Map/tests/RectangleTest.php +++ b/src/Map/tests/RectangleTest.php @@ -26,13 +26,13 @@ public function testToArray() $southWest = new Point(1.0, 2.0); $northEast = new Point(3.0, 4.0); - $rectangle = new Rectangle($southWest, $northEast, 'Test Rectangle', $infoWindow, ['foo' => 'bar'], 'rect1'); + $rectangle = new Rectangle($southWest, $northEast, null, $infoWindow, ['foo' => 'bar'], 'rect1'); $array = $rectangle->toArray(); self::assertSame([ 'southWest' => ['lat' => 1.0, 'lng' => 2.0], 'northEast' => ['lat' => 3.0, 'lng' => 4.0], - 'title' => 'Test Rectangle', + 'title' => null, 'infoWindow' => $infoWindow->toArray(), 'extra' => ['foo' => 'bar'], 'id' => 'rect1', @@ -44,7 +44,7 @@ public function testFromArray() $data = [ 'southWest' => ['lat' => 1.0, 'lng' => 2.0], 'northEast' => ['lat' => 3.0, 'lng' => 4.0], - 'title' => 'Test Rectangle', + 'title' => null, 'infoWindow' => ['content' => 'Hello'], 'extra' => ['foo' => 'bar'], 'id' => 'rect1', @@ -56,7 +56,7 @@ public function testFromArray() self::assertSame([ 'southWest' => ['lat' => 1.0, 'lng' => 2.0], 'northEast' => ['lat' => 3.0, 'lng' => 4.0], - 'title' => 'Test Rectangle', + 'title' => null, 'infoWindow' => [ 'headerContent' => null, 'content' => 'Hello',