From 29e53aa182ab98ec8f7e4729995ab07d7a437aef Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Sun, 22 Jun 2025 22:06:28 +0200 Subject: [PATCH 1/2] [Map] Prefix generic types from bridges by "Bridge" --- .../assets/dist/abstract_map_controller.d.ts | 100 +++++++------- src/Map/assets/src/abstract_map_controller.ts | 126 +++++++++--------- 2 files changed, 113 insertions(+), 113 deletions(-) diff --git a/src/Map/assets/dist/abstract_map_controller.d.ts b/src/Map/assets/dist/abstract_map_controller.d.ts index fe4e9038179..ebdc32022ff 100644 --- a/src/Map/assets/dist/abstract_map_controller.d.ts +++ b/src/Map/assets/dist/abstract_map_controller.d.ts @@ -26,55 +26,55 @@ export type Icon = { type: typeof IconTypes.Svg; html: string; }); -export type MarkerDefinition = WithIdentifier<{ +export type MarkerDefinition = WithIdentifier<{ position: Point; title: string | null; - infoWindow?: InfoWindowWithoutPositionDefinition; + infoWindow?: InfoWindowWithoutPositionDefinition; icon?: Icon; - rawOptions?: MarkerOptions; + rawOptions?: BridgeMarkerOptions; extra: Record; }>; -export type PolygonDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; +export type PolygonDefinition = WithIdentifier<{ + infoWindow?: InfoWindowWithoutPositionDefinition; points: Array | Array>; title: string | null; rawOptions?: PolygonOptions; extra: Record; }>; -export type PolylineDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; +export type PolylineDefinition = WithIdentifier<{ + infoWindow?: InfoWindowWithoutPositionDefinition; points: Array; title: string | null; rawOptions?: PolylineOptions; extra: Record; }>; -export type CircleDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; +export type CircleDefinition = WithIdentifier<{ + infoWindow?: InfoWindowWithoutPositionDefinition; center: Point; radius: number; title: string | null; rawOptions?: CircleOptions; extra: Record; }>; -export type RectangleDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; +export type RectangleDefinition = WithIdentifier<{ + infoWindow?: InfoWindowWithoutPositionDefinition; southWest: Point; northEast: Point; title: string | null; rawOptions?: RectangleOptions; extra: Record; }>; -export type InfoWindowDefinition = { +export type InfoWindowDefinition = { headerContent: string | null; content: string | null; position: Point; opened: boolean; autoClose: boolean; - rawOptions?: InfoWindowOptions; + rawOptions?: BridgeInfoWindowOptions; extra: Record; }; -export type InfoWindowWithoutPositionDefinition = Omit, 'position'>; -export default abstract class extends Controller { +export type InfoWindowWithoutPositionDefinition = Omit, 'position'>; +export default abstract class extends Controller { static values: { providerOptions: ObjectConstructor; center: ObjectConstructor; @@ -90,11 +90,11 @@ export default abstract class>; - polygonsValue: Array>; - polylinesValue: Array>; - circlesValue: Array>; - rectanglesValue: Array>; + markersValue: Array>; + polygonsValue: Array>; + polylinesValue: Array>; + circlesValue: Array>; + rectanglesValue: Array>; optionsValue: MapOptions; hasCenterValue: boolean; hasZoomValue: boolean; @@ -105,13 +105,13 @@ export default abstract class; - protected polygons: globalThis.Map; - protected polylines: globalThis.Map; - protected circles: globalThis.Map; - protected rectangles: globalThis.Map; - protected infoWindows: Array; + protected map: BridgeMap; + protected markers: Map; + protected polygons: Map; + protected polylines: Map; + protected circles: Map; + protected rectangles: Map; + protected infoWindows: Array; private isConnected; private createMarker; private createPolygon; @@ -121,9 +121,9 @@ export default abstract class): void; connect(): void; createInfoWindow({ definition, element, }: { - definition: InfoWindowWithoutPositionDefinition; - element: Marker | Polygon | Polyline | Circle | Rectangle; - }): InfoWindow; + definition: InfoWindowWithoutPositionDefinition; + element: BridgeMarker | BridgePolygon | BridgePolyline | BridgeCircle | BridgeRectangle; + }): BridgeInfoWindow; abstract centerValueChanged(): void; abstract zoomValueChanged(): void; markersValueChanged(): void; @@ -135,35 +135,35 @@ export default abstract class; - }): Marker; - protected abstract doRemoveMarker(marker: Marker): void; + definition: MarkerDefinition; + }): BridgeMarker; + protected abstract doRemoveMarker(marker: BridgeMarker): void; protected abstract doCreatePolygon({ definition }: { - definition: PolygonDefinition; - }): Polygon; - protected abstract doRemovePolygon(polygon: Polygon): void; + definition: PolygonDefinition; + }): BridgePolygon; + protected abstract doRemovePolygon(polygon: BridgePolygon): void; protected abstract doCreatePolyline({ definition }: { - definition: PolylineDefinition; - }): Polyline; - protected abstract doRemovePolyline(polyline: Polyline): void; + definition: PolylineDefinition; + }): BridgePolyline; + protected abstract doRemovePolyline(polyline: BridgePolyline): void; protected abstract doCreateCircle({ definition }: { - definition: CircleDefinition; - }): Circle; - protected abstract doRemoveCircle(circle: Circle): void; + definition: CircleDefinition; + }): BridgeCircle; + protected abstract doRemoveCircle(circle: BridgeCircle): void; protected abstract doCreateRectangle({ definition }: { - definition: RectangleDefinition; - }): Rectangle; - protected abstract doRemoveRectangle(rectangle: Rectangle): void; + definition: RectangleDefinition; + }): BridgeRectangle; + protected abstract doRemoveRectangle(rectangle: BridgeRectangle): void; protected abstract doCreateInfoWindow({ definition, element, }: { - definition: InfoWindowWithoutPositionDefinition; - element: Marker | Polygon | Polyline | Circle | Rectangle; - }): InfoWindow; + definition: InfoWindowWithoutPositionDefinition; + element: BridgeMarker | BridgePolygon | BridgePolyline | BridgeCircle | BridgeRectangle; + }): BridgeInfoWindow; protected abstract doCreateIcon({ definition, element }: { definition: Icon; - element: Marker; + element: BridgeMarker; }): void; private createDrawingFactory; private onDrawChanged; diff --git a/src/Map/assets/src/abstract_map_controller.ts b/src/Map/assets/src/abstract_map_controller.ts index 007dbe2cfca..9a1c5aedc50 100644 --- a/src/Map/assets/src/abstract_map_controller.ts +++ b/src/Map/assets/src/abstract_map_controller.ts @@ -28,15 +28,15 @@ export type Icon = { } ); -export type MarkerDefinition = WithIdentifier<{ +export type MarkerDefinition = WithIdentifier<{ position: Point; title: string | null; - infoWindow?: InfoWindowWithoutPositionDefinition; + infoWindow?: InfoWindowWithoutPositionDefinition; icon?: Icon; /** * Raw options passed to the marker constructor, specific to the map provider (e.g.: `L.marker()` for Leaflet). */ - rawOptions?: MarkerOptions; + rawOptions?: BridgeMarkerOptions; /** * Extra data defined by the developer. * They are not directly used by the Stimulus controller, but they can be used by the developer with event listeners: @@ -46,8 +46,8 @@ export type MarkerDefinition = WithIdentifier< extra: Record; }>; -export type PolygonDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; +export type PolygonDefinition = WithIdentifier<{ + infoWindow?: InfoWindowWithoutPositionDefinition; points: Array | Array>; title: string | null; /** @@ -63,8 +63,8 @@ export type PolygonDefinition = WithIdentifie extra: Record; }>; -export type PolylineDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; +export type PolylineDefinition = WithIdentifier<{ + infoWindow?: InfoWindowWithoutPositionDefinition; points: Array; title: string | null; /** @@ -80,8 +80,8 @@ export type PolylineDefinition = WithIdentif extra: Record; }>; -export type CircleDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; +export type CircleDefinition = WithIdentifier<{ + infoWindow?: InfoWindowWithoutPositionDefinition; center: Point; radius: number; title: string | null; @@ -98,8 +98,8 @@ export type CircleDefinition = WithIdentifier< extra: Record; }>; -export type RectangleDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; +export type RectangleDefinition = WithIdentifier<{ + infoWindow?: InfoWindowWithoutPositionDefinition; southWest: Point; northEast: Point; title: string | null; @@ -116,7 +116,7 @@ export type RectangleDefinition = WithIdent extra: Record; }>; -export type InfoWindowDefinition = { +export type InfoWindowDefinition = { headerContent: string | null; content: string | null; position: Point; @@ -126,7 +126,7 @@ export type InfoWindowDefinition = { * Raw options passed to the info window constructor, * specific to the map provider (e.g.: `google.maps.InfoWindow()` for Google Maps). */ - rawOptions?: InfoWindowOptions; + rawOptions?: BridgeInfoWindowOptions; /** * Extra data defined by the developer. * They are not directly used by the Stimulus controller, but they can be used by the developer with event listeners: @@ -136,23 +136,23 @@ export type InfoWindowDefinition = { extra: Record; }; -export type InfoWindowWithoutPositionDefinition = Omit, 'position'>; +export type InfoWindowWithoutPositionDefinition = Omit, 'position'>; export default abstract class< - MapOptions, - Map, - MarkerOptions, - Marker, - InfoWindowOptions, - InfoWindow, - PolygonOptions, - Polygon, - PolylineOptions, - Polyline, - CircleOptions, - Circle, - RectangleOptions, - Rectangle, + MapOptions, // Normalized `*Options` PHP class from Bridge (to not be confused with the JS Map class options) + BridgeMap, // The JavaScript Map class from Bridge (e.g.: `L.Map` for Leaflet, `google.maps.Map` for Google Maps) + BridgeMarkerOptions, // The options for the JavaScript Marker class from Bridge + BridgeMarker, // The JavaScript Marker class from Bridge + BridgeInfoWindowOptions, // The options for the JavaScript InfoWindow class from Bridge + BridgeInfoWindow, // The JavaScript InfoWindow class from Bridge + BridgePolygonOptions, // The options for the JavaScript Polygon class from Bridge + BridgePolygon, // The JavaScript Polygon class from Bridge + BridgePolylineOptions, // The options for the JavaScript Polyline class from Bridge + BridgePolyline, // The JavaScript Polyline class from Bridge + BridgeCircleOptions, // The options for the JavaScript Circle class from Bridge + BridgeCircle, // The JavaScript Circle class from Bridge + BridgeRectangleOptions, // The options for the JavaScript Rectangle class from Bridge + BridgeRectangle, // The JavaScript Rectangle class from Bridge > extends Controller { static values = { providerOptions: Object, @@ -170,11 +170,11 @@ export default abstract class< declare centerValue: Point | null; declare zoomValue: number | null; declare fitBoundsToMarkersValue: boolean; - declare markersValue: Array>; - declare polygonsValue: Array>; - declare polylinesValue: Array>; - declare circlesValue: Array>; - declare rectanglesValue: Array>; + declare markersValue: Array>; + declare polygonsValue: Array>; + declare polylinesValue: Array>; + declare circlesValue: Array>; + declare rectanglesValue: Array>; declare optionsValue: MapOptions; declare hasCenterValue: boolean; @@ -187,20 +187,20 @@ export default abstract class< declare hasRectanglesValue: boolean; declare hasOptionsValue: boolean; - protected map: Map; - protected markers = new Map(); - protected polygons = new Map(); - protected polylines = new Map(); - protected circles = new Map(); - protected rectangles = new Map(); - protected infoWindows: Array = []; + protected map: BridgeMap; + protected markers = new Map(); + protected polygons = new Map(); + protected polylines = new Map(); + protected circles = new Map(); + protected rectangles = new Map(); + protected infoWindows: Array = []; private isConnected = false; - private createMarker: ({ definition }: { definition: MarkerDefinition }) => Marker; - private createPolygon: ({ definition }: { definition: PolygonDefinition }) => Polygon; - private createPolyline: ({ definition }: { definition: PolylineDefinition }) => Polyline; - private createCircle: ({ definition }: { definition: CircleDefinition }) => Circle; - private createRectangle: ({ definition }: { definition: RectangleDefinition }) => Rectangle; + private createMarker: ({ definition }: { definition: MarkerDefinition }) => BridgeMarker; + private createPolygon: ({ definition }: { definition: PolygonDefinition }) => BridgePolygon; + private createPolyline: ({ definition }: { definition: PolylineDefinition }) => BridgePolyline; + private createCircle: ({ definition }: { definition: CircleDefinition }) => BridgeCircle; + private createRectangle: ({ definition }: { definition: RectangleDefinition }) => BridgeRectangle; protected abstract dispatchEvent(name: string, payload: Record): void; @@ -248,9 +248,9 @@ export default abstract class< definition, element, }: { - definition: InfoWindowWithoutPositionDefinition; - element: Marker | Polygon | Polyline | Circle | Rectangle; - }): InfoWindow { + definition: InfoWindowWithoutPositionDefinition; + element: BridgeMarker | BridgePolygon | BridgePolyline | BridgeCircle | BridgeRectangle; + }): BridgeInfoWindow { this.dispatchEvent('info-window:before-create', { definition, element }); const infoWindow = this.doCreateInfoWindow({ definition, element }); this.dispatchEvent('info-window:after-create', { infoWindow, definition, element }); @@ -314,38 +314,38 @@ export default abstract class< //endregion //region Abstract factory methods to be implemented by the concrete classes, they are specific to the map provider - protected abstract doCreateMap({ center, zoom, options }: { center: Point | null; zoom: number | null; options: MapOptions }): Map; + protected abstract doCreateMap({ center, zoom, options }: { center: Point | null; zoom: number | null; options: MapOptions }): BridgeMap; protected abstract doFitBoundsToMarkers(): void; - protected abstract doCreateMarker({ definition }: { definition: MarkerDefinition }): Marker; + protected abstract doCreateMarker({ definition }: { definition: MarkerDefinition }): BridgeMarker; - protected abstract doRemoveMarker(marker: Marker): void; + protected abstract doRemoveMarker(marker: BridgeMarker): void; - protected abstract doCreatePolygon({ definition }: { definition: PolygonDefinition }): Polygon; + protected abstract doCreatePolygon({ definition }: { definition: PolygonDefinition }): BridgePolygon; - protected abstract doRemovePolygon(polygon: Polygon): void; + protected abstract doRemovePolygon(polygon: BridgePolygon): void; - protected abstract doCreatePolyline({ definition }: { definition: PolylineDefinition }): Polyline; + protected abstract doCreatePolyline({ definition }: { definition: PolylineDefinition }): BridgePolyline; - protected abstract doRemovePolyline(polyline: Polyline): void; + protected abstract doRemovePolyline(polyline: BridgePolyline): void; - protected abstract doCreateCircle({ definition }: { definition: CircleDefinition }): Circle; + protected abstract doCreateCircle({ definition }: { definition: CircleDefinition }): BridgeCircle; - protected abstract doRemoveCircle(circle: Circle): void; + protected abstract doRemoveCircle(circle: BridgeCircle): void; - protected abstract doCreateRectangle({ definition }: { definition: RectangleDefinition }): Rectangle; + protected abstract doCreateRectangle({ definition }: { definition: RectangleDefinition }): BridgeRectangle; - protected abstract doRemoveRectangle(rectangle: Rectangle): void; + protected abstract doRemoveRectangle(rectangle: BridgeRectangle): void; protected abstract doCreateInfoWindow({ definition, element, }: { - definition: InfoWindowWithoutPositionDefinition; - element: Marker | Polygon | Polyline | Circle | Rectangle; - }): InfoWindow; - protected abstract doCreateIcon({ definition, element }: { definition: Icon; element: Marker }): void; + definition: InfoWindowWithoutPositionDefinition; + element: BridgeMarker | BridgePolygon | BridgePolyline | BridgeCircle | BridgeRectangle; + }): BridgeInfoWindow; + protected abstract doCreateIcon({ definition, element }: { definition: Icon; element: BridgeMarker }): void; //endregion From e2aaec5ee9a6447ee1ce8d9f35f513c934d884bc Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Sun, 22 Jun 2025 23:33:40 +0200 Subject: [PATCH 2/2] [Map] Remove `InfoWindowWithoutPositionDefinition` type (it was always kinda weird) --- .../assets/dist/abstract_map_controller.d.ts | 15 ++++++----- src/Map/assets/src/abstract_map_controller.ts | 25 ++++++++++++------- .../Google/assets/dist/map_controller.d.ts | 4 +-- .../Google/assets/src/map_controller.ts | 4 +-- .../Leaflet/assets/dist/map_controller.d.ts | 4 +-- .../Leaflet/assets/src/map_controller.ts | 13 ++++++++-- 6 files changed, 40 insertions(+), 25 deletions(-) diff --git a/src/Map/assets/dist/abstract_map_controller.d.ts b/src/Map/assets/dist/abstract_map_controller.d.ts index ebdc32022ff..cf52843d7b5 100644 --- a/src/Map/assets/dist/abstract_map_controller.d.ts +++ b/src/Map/assets/dist/abstract_map_controller.d.ts @@ -29,27 +29,27 @@ export type Icon = { export type MarkerDefinition = WithIdentifier<{ position: Point; title: string | null; - infoWindow?: InfoWindowWithoutPositionDefinition; + infoWindow?: Omit, 'position'>; icon?: Icon; rawOptions?: BridgeMarkerOptions; extra: Record; }>; export type PolygonDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; + infoWindow?: Omit, 'position'>; points: Array | Array>; title: string | null; rawOptions?: PolygonOptions; extra: Record; }>; export type PolylineDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; + infoWindow?: Omit, 'position'>; points: Array; title: string | null; rawOptions?: PolylineOptions; extra: Record; }>; export type CircleDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; + infoWindow?: Omit, 'position'>; center: Point; radius: number; title: string | null; @@ -57,7 +57,7 @@ export type CircleDefinition = WithIdent extra: Record; }>; export type RectangleDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; + infoWindow?: Omit, 'position'>; southWest: Point; northEast: Point; title: string | null; @@ -73,7 +73,6 @@ export type InfoWindowDefinition = { rawOptions?: BridgeInfoWindowOptions; extra: Record; }; -export type InfoWindowWithoutPositionDefinition = Omit, 'position'>; export default abstract class extends Controller { static values: { providerOptions: ObjectConstructor; @@ -121,7 +120,7 @@ export default abstract class): void; connect(): void; createInfoWindow({ definition, element, }: { - definition: InfoWindowWithoutPositionDefinition; + definition: Omit, 'position'>; element: BridgeMarker | BridgePolygon | BridgePolyline | BridgeCircle | BridgeRectangle; }): BridgeInfoWindow; abstract centerValueChanged(): void; @@ -158,7 +157,7 @@ export default abstract class; + definition: Omit, 'position'>; element: BridgeMarker | BridgePolygon | BridgePolyline | BridgeCircle | BridgeRectangle; }): BridgeInfoWindow; protected abstract doCreateIcon({ definition, element }: { diff --git a/src/Map/assets/src/abstract_map_controller.ts b/src/Map/assets/src/abstract_map_controller.ts index 9a1c5aedc50..09b6460a75e 100644 --- a/src/Map/assets/src/abstract_map_controller.ts +++ b/src/Map/assets/src/abstract_map_controller.ts @@ -1,3 +1,12 @@ +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + import { Controller } from '@hotwired/stimulus'; export type Point = { lat: number; lng: number }; @@ -31,7 +40,7 @@ export type Icon = { export type MarkerDefinition = WithIdentifier<{ position: Point; title: string | null; - infoWindow?: InfoWindowWithoutPositionDefinition; + infoWindow?: Omit, 'position'>; icon?: Icon; /** * Raw options passed to the marker constructor, specific to the map provider (e.g.: `L.marker()` for Leaflet). @@ -47,7 +56,7 @@ export type MarkerDefinition = Wit }>; export type PolygonDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; + infoWindow?: Omit, 'position'>; points: Array | Array>; title: string | null; /** @@ -64,7 +73,7 @@ export type PolygonDefinition = WithIde }>; export type PolylineDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; + infoWindow?: Omit, 'position'>; points: Array; title: string | null; /** @@ -81,7 +90,7 @@ export type PolylineDefinition = WithI }>; export type CircleDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; + infoWindow?: Omit, 'position'>; center: Point; radius: number; title: string | null; @@ -99,7 +108,7 @@ export type CircleDefinition = WithIdent }>; export type RectangleDefinition = WithIdentifier<{ - infoWindow?: InfoWindowWithoutPositionDefinition; + infoWindow?: Omit, 'position'>; southWest: Point; northEast: Point; title: string | null; @@ -136,8 +145,6 @@ export type InfoWindowDefinition = { extra: Record; }; -export type InfoWindowWithoutPositionDefinition = Omit, 'position'>; - export default abstract class< MapOptions, // Normalized `*Options` PHP class from Bridge (to not be confused with the JS Map class options) BridgeMap, // The JavaScript Map class from Bridge (e.g.: `L.Map` for Leaflet, `google.maps.Map` for Google Maps) @@ -248,7 +255,7 @@ export default abstract class< definition, element, }: { - definition: InfoWindowWithoutPositionDefinition; + definition: Omit, 'position'>; element: BridgeMarker | BridgePolygon | BridgePolyline | BridgeCircle | BridgeRectangle; }): BridgeInfoWindow { this.dispatchEvent('info-window:before-create', { definition, element }); @@ -342,7 +349,7 @@ export default abstract class< definition, element, }: { - definition: InfoWindowWithoutPositionDefinition; + definition: Omit, 'position'>; element: BridgeMarker | BridgePolygon | BridgePolyline | BridgeCircle | BridgeRectangle; }): BridgeInfoWindow; protected abstract doCreateIcon({ definition, element }: { definition: Icon; element: BridgeMarker }): void; diff --git a/src/Map/src/Bridge/Google/assets/dist/map_controller.d.ts b/src/Map/src/Bridge/Google/assets/dist/map_controller.d.ts index 63691d2fbb1..26d01174674 100644 --- a/src/Map/src/Bridge/Google/assets/dist/map_controller.d.ts +++ b/src/Map/src/Bridge/Google/assets/dist/map_controller.d.ts @@ -1,5 +1,5 @@ import type { LoaderOptions } from '@googlemaps/js-api-loader'; -import type { CircleDefinition, Icon, InfoWindowWithoutPositionDefinition, MarkerDefinition, Point, PolygonDefinition, PolylineDefinition, RectangleDefinition } from '@symfony/ux-map'; +import type { CircleDefinition, Icon, InfoWindowDefinition, MarkerDefinition, Point, PolygonDefinition, PolylineDefinition, RectangleDefinition } from '@symfony/ux-map'; import AbstractMapController from '@symfony/ux-map'; type MapOptions = Pick; export default class extends AbstractMapController { @@ -36,7 +36,7 @@ export default class extends AbstractMapController; + definition: Omit, 'position'>; element: google.maps.marker.AdvancedMarkerElement | google.maps.Polygon | google.maps.Polyline | google.maps.Circle | google.maps.Rectangle; }): google.maps.InfoWindow; protected doFitBoundsToMarkers(): void; 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 6037fb0cc68..4ede9db22e5 100644 --- a/src/Map/src/Bridge/Google/assets/src/map_controller.ts +++ b/src/Map/src/Bridge/Google/assets/src/map_controller.ts @@ -12,7 +12,7 @@ import { Loader } from '@googlemaps/js-api-loader'; import type { CircleDefinition, Icon, - InfoWindowWithoutPositionDefinition, + InfoWindowDefinition, MarkerDefinition, Point, PolygonDefinition, @@ -295,7 +295,7 @@ export default class extends AbstractMapController< definition, element, }: { - definition: InfoWindowWithoutPositionDefinition; + definition: Omit, 'position'>; element: google.maps.marker.AdvancedMarkerElement | google.maps.Polygon | google.maps.Polyline | google.maps.Circle | google.maps.Rectangle; }): google.maps.InfoWindow { const { headerContent, content, opened, autoClose, rawOptions = {} } = definition; diff --git a/src/Map/src/Bridge/Leaflet/assets/dist/map_controller.d.ts b/src/Map/src/Bridge/Leaflet/assets/dist/map_controller.d.ts index 40eb259f702..69fd9658083 100644 --- a/src/Map/src/Bridge/Leaflet/assets/dist/map_controller.d.ts +++ b/src/Map/src/Bridge/Leaflet/assets/dist/map_controller.d.ts @@ -1,4 +1,4 @@ -import type { CircleDefinition, Icon, InfoWindowWithoutPositionDefinition, MarkerDefinition, Point, PolygonDefinition, PolylineDefinition, RectangleDefinition } from '@symfony/ux-map'; +import type { CircleDefinition, Icon, InfoWindowDefinition, MarkerDefinition, Point, PolygonDefinition, PolylineDefinition, RectangleDefinition } from '@symfony/ux-map'; import AbstractMapController from '@symfony/ux-map'; import 'leaflet/dist/leaflet.min.css'; import type { CircleOptions, ControlPosition, MapOptions as LeafletMapOptions, MarkerOptions, PolylineOptions as PolygonOptions, PolylineOptions, PopupOptions, PolylineOptions as RectangleOptions } from 'leaflet'; @@ -53,7 +53,7 @@ export default class extends AbstractMapController; + definition: Omit, 'position'>; element: L.Marker | L.Polygon | L.Polyline | L.Circle | L.Rectangle; }): L.Popup; protected doCreateIcon({ definition, element }: { 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 45133521756..1f13fa384c5 100644 --- a/src/Map/src/Bridge/Leaflet/assets/src/map_controller.ts +++ b/src/Map/src/Bridge/Leaflet/assets/src/map_controller.ts @@ -1,7 +1,16 @@ +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + import type { CircleDefinition, Icon, - InfoWindowWithoutPositionDefinition, + InfoWindowDefinition, MarkerDefinition, Point, PolygonDefinition, @@ -224,7 +233,7 @@ export default class extends AbstractMapController< definition, element, }: { - definition: InfoWindowWithoutPositionDefinition; + definition: Omit, 'position'>; element: L.Marker | L.Polygon | L.Polyline | L.Circle | L.Rectangle; }): L.Popup { const { headerContent, content, rawOptions = {}, ...otherOptions } = definition;