Skip to content

Commit a10c68e

Browse files
committed
[Map] Remove deprecations from Map
1 parent 955b745 commit a10c68e

26 files changed

+50
-275
lines changed

src/Map/CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
- Minimum required Symfony version is now 6.4
66
- Minimum required PHP version is now 8.2
7+
- Remove `render_map()` Twig function, use `ux_map()` instead
8+
- Remove option `title` from `Polygon`, `Polyline`, `Rectangle` and `Circle`, use `infoWindow` instead
9+
- Remove property `rawOptions` from `ux:map:*:before-create` events, use `bridgeOptions` instead.
710

811
## 2.30
912

1013
- Ensure compatibility with PHP 8.5
11-
12-
## 2.30
13-
1414
- Deprecate option `title` from `Polygon`, `Polyline`, `Rectangle` and `Circle` in favor of `infoWindow`
1515

1616
## 2.29.0

src/Map/assets/dist/abstract_map_controller.d.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,41 +42,32 @@ type MarkerDefinition<BridgeMarkerOptions, BridgeInfoWindowOptions> = WithIdenti
4242
title: string | null;
4343
infoWindow?: Omit<InfoWindowDefinition<BridgeInfoWindowOptions>, 'position'>;
4444
icon?: Icon;
45-
rawOptions?: BridgeMarkerOptions;
4645
bridgeOptions?: BridgeMarkerOptions;
4746
extra: ExtraData;
4847
}>;
4948
type PolygonDefinition<BridgePolygonOptions, BridgeInfoWindowOptions> = WithIdentifier<{
5049
infoWindow?: Omit<InfoWindowDefinition<BridgeInfoWindowOptions>, 'position'>;
5150
points: Array<Point> | Array<Array<Point>>;
52-
title: string | null;
53-
rawOptions?: BridgePolygonOptions;
5451
bridgeOptions?: BridgePolygonOptions;
5552
extra: ExtraData;
5653
}>;
5754
type PolylineDefinition<BridgePolylineOptions, BridgeInfoWindowOptions> = WithIdentifier<{
5855
infoWindow?: Omit<InfoWindowDefinition<BridgeInfoWindowOptions>, 'position'>;
5956
points: Array<Point>;
60-
title: string | null;
61-
rawOptions?: BridgePolylineOptions;
6257
bridgeOptions?: BridgePolylineOptions;
6358
extra: ExtraData;
6459
}>;
6560
type CircleDefinition<BridgeCircleOptions, BridgeInfoWindowOptions> = WithIdentifier<{
6661
infoWindow?: Omit<InfoWindowDefinition<BridgeInfoWindowOptions>, 'position'>;
6762
center: Point;
6863
radius: number;
69-
title: string | null;
70-
rawOptions?: BridgeCircleOptions;
7164
bridgeOptions?: BridgeCircleOptions;
7265
extra: ExtraData;
7366
}>;
7467
type RectangleDefinition<BridgeRectangleOptions, BridgeInfoWindowOptions> = WithIdentifier<{
7568
infoWindow?: Omit<InfoWindowDefinition<BridgeInfoWindowOptions>, 'position'>;
7669
southWest: Point;
7770
northEast: Point;
78-
title: string | null;
79-
rawOptions?: BridgeRectangleOptions;
8071
bridgeOptions?: BridgeRectangleOptions;
8172
extra: ExtraData;
8273
}>;
@@ -86,7 +77,6 @@ type InfoWindowDefinition<BridgeInfoWindowOptions> = {
8677
position: Point;
8778
opened: boolean;
8879
autoClose: boolean;
89-
rawOptions?: BridgeInfoWindowOptions;
9080
bridgeOptions?: BridgeInfoWindowOptions;
9181
extra: ExtraData;
9282
};

src/Map/assets/dist/abstract_map_controller.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,6 @@ var abstract_map_controller_default = class extends Controller {
102102
const eventAfter = `${type}:after-create`;
103103
return ({ definition }) => {
104104
this.dispatchEvent(eventBefore, { definition });
105-
if (typeof definition.rawOptions !== "undefined") {
106-
console.warn(
107-
`[Symfony UX Map] The event "${eventBefore}" added a deprecated "rawOptions" property to the definition, it will be removed in a next major version, replace it with "bridgeOptions" instead.`,
108-
definition
109-
);
110-
}
111105
const drawing = factory({ definition });
112106
this.dispatchEvent(eventAfter, { [type]: drawing, definition });
113107
draws.set(definition["@id"], drawing);

src/Map/assets/src/abstract_map_controller.ts

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ export type MarkerDefinition<BridgeMarkerOptions, BridgeInfoWindowOptions> = Wit
6464
title: string | null;
6565
infoWindow?: Omit<InfoWindowDefinition<BridgeInfoWindowOptions>, 'position'>;
6666
icon?: Icon;
67-
/**
68-
* @deprecated since Symfony UX Map 2.27, use "bridgeOptions" instead.
69-
* Raw options passed to the marker constructor, specific to the map provider (e.g.: `L.marker()` for Leaflet).
70-
*/
71-
rawOptions?: BridgeMarkerOptions;
7267
/**
7368
* Additional options passed to the Marker constructor.
7469
* These options are specific to the Map Bridge, and can be defined through `ux:map:marker:before-create` event.
@@ -86,15 +81,6 @@ export type MarkerDefinition<BridgeMarkerOptions, BridgeInfoWindowOptions> = Wit
8681
export type PolygonDefinition<BridgePolygonOptions, BridgeInfoWindowOptions> = WithIdentifier<{
8782
infoWindow?: Omit<InfoWindowDefinition<BridgeInfoWindowOptions>, 'position'>;
8883
points: Array<Point> | Array<Array<Point>>;
89-
/**
90-
* @deprecated since Symfony UX Map 2.29, use "infoWindow" instead
91-
*/
92-
title: string | null;
93-
/**
94-
* @deprecated since Symfony UX Map 2.27, use "bridgeOptions" instead.
95-
* Raw options passed to the polygon constructor, specific to the map provider (e.g.: `L.polygon()` for Leaflet).
96-
*/
97-
rawOptions?: BridgePolygonOptions;
9884
/**
9985
* Additional options passed to the Polygon constructor.
10086
* These options are specific to the Map Bridge, and can be defined through `ux:map:polygon:before-create` event.
@@ -112,15 +98,6 @@ export type PolygonDefinition<BridgePolygonOptions, BridgeInfoWindowOptions> = W
11298
export type PolylineDefinition<BridgePolylineOptions, BridgeInfoWindowOptions> = WithIdentifier<{
11399
infoWindow?: Omit<InfoWindowDefinition<BridgeInfoWindowOptions>, 'position'>;
114100
points: Array<Point>;
115-
/**
116-
* @deprecated since Symfony UX Map 2.29, use "infoWindow" instead
117-
*/
118-
title: string | null;
119-
/**
120-
* @deprecated since Symfony UX Map 2.27, use "bridgeOptions" instead.
121-
* Raw options passed to the polyline constructor, specific to the map provider (e.g.: `L.polyline()` for Leaflet).
122-
*/
123-
rawOptions?: BridgePolylineOptions;
124101
/**
125102
* Additional options passed to the Polyline constructor.
126103
* These options are specific to the Map Bridge, and can be defined through `ux:map:polyline:before-create` event.
@@ -139,15 +116,6 @@ export type CircleDefinition<BridgeCircleOptions, BridgeInfoWindowOptions> = Wit
139116
infoWindow?: Omit<InfoWindowDefinition<BridgeInfoWindowOptions>, 'position'>;
140117
center: Point;
141118
radius: number;
142-
/**
143-
* @deprecated since Symfony UX Map 2.29, use "infoWindow" instead
144-
*/
145-
title: string | null;
146-
/**
147-
* @deprecated since Symfony UX Map 2.27, use "bridgeOptions" instead.
148-
* Raw options passed to the circle constructor, specific to the map provider (e.g.: `L.circle()` for Leaflet).
149-
*/
150-
rawOptions?: BridgeCircleOptions;
151119
/**
152120
* Additional options passed to the Circle constructor.
153121
* These options are specific to the Map Bridge, and can be defined through `ux:map:circle:before-create` event.
@@ -166,15 +134,6 @@ export type RectangleDefinition<BridgeRectangleOptions, BridgeInfoWindowOptions>
166134
infoWindow?: Omit<InfoWindowDefinition<BridgeInfoWindowOptions>, 'position'>;
167135
southWest: Point;
168136
northEast: Point;
169-
/**
170-
* @deprecated since Symfony UX Map 2.29, use "infoWindow" instead
171-
*/
172-
title: string | null;
173-
/**
174-
* @deprecated since Symfony UX Map 2.27, use "bridgeOptions" instead.
175-
* Raw options passed to the rectangle constructor, specific to the map provider (e.g.: `L.rectangle()` for Leaflet).
176-
*/
177-
rawOptions?: BridgeRectangleOptions;
178137
/**
179138
* Additional options passed to the Rectangle constructor.
180139
* These options are specific to the Map Bridge, and can be defined through `ux:map:rectangle:before-create` event.
@@ -195,11 +154,6 @@ export type InfoWindowDefinition<BridgeInfoWindowOptions> = {
195154
position: Point;
196155
opened: boolean;
197156
autoClose: boolean;
198-
/**
199-
* @deprecated since Symfony UX Map 2.27, use "bridgeOptions" instead.
200-
* Raw options passed to the info window constructor, specific to the map provider (e.g.: `google.maps.InfoWindow()` for Google Maps).
201-
*/
202-
rawOptions?: BridgeInfoWindowOptions;
203157
/**
204158
* Additional options passed to the InfoWindow constructor.
205159
* These options are specific to the Map Bridge, and can be defined through `ux:map:info-window:before-create` event.
@@ -466,13 +420,6 @@ export default abstract class<
466420
return ({ definition }: { definition: WithIdentifier<any> }) => {
467421
this.dispatchEvent(eventBefore, { definition });
468422

469-
if (typeof definition.rawOptions !== 'undefined') {
470-
console.warn(
471-
`[Symfony UX Map] The event "${eventBefore}" added a deprecated "rawOptions" property to the definition, it will be removed in a next major version, replace it with "bridgeOptions" instead.`,
472-
definition
473-
);
474-
}
475-
476423
const drawing = factory({ definition }) as Draw;
477424
this.dispatchEvent(eventAfter, { [type]: drawing, definition });
478425

src/Map/src/Bridge/Google/assets/dist/map_controller.js

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,6 @@ var abstract_map_controller_default = class extends Controller {
105105
const eventAfter = `${type}:after-create`;
106106
return ({ definition }) => {
107107
this.dispatchEvent(eventBefore, { definition });
108-
if (typeof definition.rawOptions !== "undefined") {
109-
console.warn(
110-
`[Symfony UX Map] The event "${eventBefore}" added a deprecated "rawOptions" property to the definition, it will be removed in a next major version, replace it with "bridgeOptions" instead.`,
111-
definition
112-
);
113-
}
114108
const drawing = factory({ definition });
115109
this.dispatchEvent(eventAfter, { [type]: drawing, definition });
116110
draws.set(definition["@id"], drawing);
@@ -236,12 +230,11 @@ var map_controller_default = class extends abstract_map_controller_default {
236230
doCreateMarker({
237231
definition
238232
}) {
239-
const { "@id": _id, position, title, infoWindow, icon, rawOptions = {}, bridgeOptions = {} } = definition;
233+
const { "@id": _id, position, title, infoWindow, icon, bridgeOptions = {} } = definition;
240234
const marker = new _google.maps.marker.AdvancedMarkerElement({
241235
position,
242236
title,
243237
map: this.map,
244-
...rawOptions,
245238
...bridgeOptions
246239
});
247240
if (infoWindow) {
@@ -258,16 +251,12 @@ var map_controller_default = class extends abstract_map_controller_default {
258251
doCreatePolygon({
259252
definition
260253
}) {
261-
const { "@id": _id, points, title, infoWindow, rawOptions = {}, bridgeOptions = {} } = definition;
254+
const { "@id": _id, points, infoWindow, bridgeOptions = {} } = definition;
262255
const polygon = new _google.maps.Polygon({
263256
paths: points,
264257
map: this.map,
265-
...rawOptions,
266258
...bridgeOptions
267259
});
268-
if (title) {
269-
polygon.set("title", title);
270-
}
271260
if (infoWindow) {
272261
this.createInfoWindow({ definition: infoWindow, element: polygon });
273262
}
@@ -279,16 +268,12 @@ var map_controller_default = class extends abstract_map_controller_default {
279268
doCreatePolyline({
280269
definition
281270
}) {
282-
const { "@id": _id, points, title, infoWindow, rawOptions = {}, bridgeOptions = {} } = definition;
271+
const { "@id": _id, points, infoWindow, bridgeOptions = {} } = definition;
283272
const polyline = new _google.maps.Polyline({
284273
path: points,
285274
map: this.map,
286-
...rawOptions,
287275
...bridgeOptions
288276
});
289-
if (title) {
290-
polyline.set("title", title);
291-
}
292277
if (infoWindow) {
293278
this.createInfoWindow({ definition: infoWindow, element: polyline });
294279
}
@@ -298,17 +283,13 @@ var map_controller_default = class extends abstract_map_controller_default {
298283
polyline.setMap(null);
299284
}
300285
doCreateCircle({ definition }) {
301-
const { "@id": _id, center, radius, title, infoWindow, rawOptions = {}, bridgeOptions = {} } = definition;
286+
const { "@id": _id, center, radius, infoWindow, bridgeOptions = {} } = definition;
302287
const circle = new _google.maps.Circle({
303288
center,
304289
radius,
305290
map: this.map,
306-
...rawOptions,
307291
...bridgeOptions
308292
});
309-
if (title) {
310-
circle.set("title", title);
311-
}
312293
if (infoWindow) {
313294
this.createInfoWindow({ definition: infoWindow, element: circle });
314295
}
@@ -320,16 +301,12 @@ var map_controller_default = class extends abstract_map_controller_default {
320301
doCreateRectangle({
321302
definition
322303
}) {
323-
const { northEast, southWest, title, infoWindow, rawOptions = {}, bridgeOptions = {} } = definition;
304+
const { northEast, southWest, infoWindow, bridgeOptions = {} } = definition;
324305
const rectangle = new _google.maps.Rectangle({
325306
bounds: new _google.maps.LatLngBounds(southWest, northEast),
326307
map: this.map,
327-
...rawOptions,
328308
...bridgeOptions
329309
});
330-
if (title) {
331-
rectangle.set("title", title);
332-
}
333310
if (infoWindow) {
334311
this.createInfoWindow({ definition: infoWindow, element: rectangle });
335312
}
@@ -342,7 +319,7 @@ var map_controller_default = class extends abstract_map_controller_default {
342319
definition,
343320
element
344321
}) {
345-
const { headerContent, content, opened, autoClose, rawOptions = {}, bridgeOptions = {} } = definition;
322+
const { headerContent, content, opened, autoClose, bridgeOptions = {} } = definition;
346323
let position = null;
347324
if (element instanceof google.maps.Circle) {
348325
position = element.getCenter();
@@ -354,7 +331,6 @@ var map_controller_default = class extends abstract_map_controller_default {
354331
headerContent: this.createTextOrElement(headerContent),
355332
content: this.createTextOrElement(content),
356333
position,
357-
...rawOptions,
358334
...bridgeOptions
359335
};
360336
const infoWindow = new _google.maps.InfoWindow(infoWindowOptions);

0 commit comments

Comments
 (0)