Skip to content

Commit f07ce73

Browse files
committed
fix build and coding standard
1 parent 7e4a134 commit f07ce73

File tree

3 files changed

+124
-5
lines changed

3 files changed

+124
-5
lines changed

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

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,68 @@
1-
import AbstractMapController from '@symfony/ux-map';
1+
import { Controller } from '@hotwired/stimulus';
22
import { Loader } from '@googlemaps/js-api-loader';
33

4+
let default_1$1 = class default_1 extends Controller {
5+
constructor() {
6+
super(...arguments);
7+
this.markers = [];
8+
this.infoWindows = [];
9+
this.polygons = [];
10+
this.polylines = [];
11+
}
12+
connect() {
13+
const { center, zoom, options, markers, polygons, polylines, fitBoundsToMarkers } = this.viewValue;
14+
this.dispatchEvent('pre-connect', { options });
15+
this.map = this.doCreateMap({ center, zoom, options });
16+
markers.forEach((marker) => this.createMarker(marker));
17+
polygons.forEach((polygon) => this.createPolygon(polygon));
18+
polylines.forEach((polyline) => this.createPolyline(polyline));
19+
if (fitBoundsToMarkers) {
20+
this.doFitBoundsToMarkers();
21+
}
22+
this.dispatchEvent('connect', {
23+
map: this.map,
24+
markers: this.markers,
25+
polygons: this.polygons,
26+
polylines: this.polylines,
27+
infoWindows: this.infoWindows,
28+
});
29+
}
30+
createMarker(definition) {
31+
this.dispatchEvent('marker:before-create', { definition });
32+
const marker = this.doCreateMarker(definition);
33+
this.dispatchEvent('marker:after-create', { marker });
34+
this.markers.push(marker);
35+
return marker;
36+
}
37+
createPolygon(definition) {
38+
this.dispatchEvent('polygon:before-create', { definition });
39+
const polygon = this.doCreatePolygon(definition);
40+
this.dispatchEvent('polygon:after-create', { polygon });
41+
this.polygons.push(polygon);
42+
return polygon;
43+
}
44+
createPolyline(definition) {
45+
this.dispatchEvent('polyline:before-create', { definition });
46+
const polyline = this.doCreatePolyline(definition);
47+
this.dispatchEvent('polyline:after-create', { polyline });
48+
this.polylines.push(polyline);
49+
return polyline;
50+
}
51+
createInfoWindow({ definition, element, }) {
52+
this.dispatchEvent('info-window:before-create', { definition, element });
53+
const infoWindow = this.doCreateInfoWindow({ definition, element });
54+
this.dispatchEvent('info-window:after-create', { infoWindow, element });
55+
this.infoWindows.push(infoWindow);
56+
return infoWindow;
57+
}
58+
};
59+
default_1$1.values = {
60+
providerOptions: Object,
61+
view: Object,
62+
};
63+
464
let _google;
5-
class default_1 extends AbstractMapController {
65+
class default_1 extends default_1$1 {
666
async connect() {
767
if (!_google) {
868
_google = { maps: {} };

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

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,68 @@
1-
import AbstractMapController from '@symfony/ux-map';
1+
import { Controller } from '@hotwired/stimulus';
22
import 'leaflet/dist/leaflet.min.css';
33
import * as L from 'leaflet';
44

5-
class map_controller extends AbstractMapController {
5+
class default_1 extends Controller {
6+
constructor() {
7+
super(...arguments);
8+
this.markers = [];
9+
this.infoWindows = [];
10+
this.polygons = [];
11+
this.polylines = [];
12+
}
13+
connect() {
14+
const { center, zoom, options, markers, polygons, polylines, fitBoundsToMarkers } = this.viewValue;
15+
this.dispatchEvent('pre-connect', { options });
16+
this.map = this.doCreateMap({ center, zoom, options });
17+
markers.forEach((marker) => this.createMarker(marker));
18+
polygons.forEach((polygon) => this.createPolygon(polygon));
19+
polylines.forEach((polyline) => this.createPolyline(polyline));
20+
if (fitBoundsToMarkers) {
21+
this.doFitBoundsToMarkers();
22+
}
23+
this.dispatchEvent('connect', {
24+
map: this.map,
25+
markers: this.markers,
26+
polygons: this.polygons,
27+
polylines: this.polylines,
28+
infoWindows: this.infoWindows,
29+
});
30+
}
31+
createMarker(definition) {
32+
this.dispatchEvent('marker:before-create', { definition });
33+
const marker = this.doCreateMarker(definition);
34+
this.dispatchEvent('marker:after-create', { marker });
35+
this.markers.push(marker);
36+
return marker;
37+
}
38+
createPolygon(definition) {
39+
this.dispatchEvent('polygon:before-create', { definition });
40+
const polygon = this.doCreatePolygon(definition);
41+
this.dispatchEvent('polygon:after-create', { polygon });
42+
this.polygons.push(polygon);
43+
return polygon;
44+
}
45+
createPolyline(definition) {
46+
this.dispatchEvent('polyline:before-create', { definition });
47+
const polyline = this.doCreatePolyline(definition);
48+
this.dispatchEvent('polyline:after-create', { polyline });
49+
this.polylines.push(polyline);
50+
return polyline;
51+
}
52+
createInfoWindow({ definition, element, }) {
53+
this.dispatchEvent('info-window:before-create', { definition, element });
54+
const infoWindow = this.doCreateInfoWindow({ definition, element });
55+
this.dispatchEvent('info-window:after-create', { infoWindow, element });
56+
this.infoWindows.push(infoWindow);
57+
return infoWindow;
58+
}
59+
}
60+
default_1.values = {
61+
providerOptions: Object,
62+
view: Object,
63+
};
64+
65+
class map_controller extends default_1 {
666
connect() {
767
L.Marker.prototype.options.icon = L.divIcon({
868
html: '<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" stroke-linecap="round" clip-rule="evenodd" viewBox="0 0 500 820"><defs><linearGradient id="__sf_ux_map_gradient_marker_fill" x1="0" x2="1" y1="0" y2="0" gradientTransform="matrix(0 -37.57 37.57 0 416.45 541)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#126FC6"/><stop offset="1" stop-color="#4C9CD1"/></linearGradient><linearGradient id="__sf_ux_map_gradient_marker_border" x1="0" x2="1" y1="0" y2="0" gradientTransform="matrix(0 -19.05 19.05 0 414.48 522.49)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#2E6C97"/><stop offset="1" stop-color="#3883B7"/></linearGradient></defs><circle cx="252.31" cy="266.24" r="83.99" fill="#fff"/><path fill="url(#__sf_ux_map_gradient_marker_fill)" stroke="url(#__sf_ux_map_gradient_marker_border)" stroke-width="1.1" d="M416.54 503.61c-6.57 0-12.04 5.7-12.04 11.87 0 2.78 1.56 6.3 2.7 8.74l9.3 17.88 9.26-17.88c1.13-2.43 2.74-5.79 2.74-8.74 0-6.18-5.38-11.87-11.96-11.87Zm0 7.16a4.69 4.69 0 1 1-.02 9.4 4.69 4.69 0 0 1 .02-9.4Z" transform="translate(-7889.1 -9807.44) scale(19.54)"/></svg>',

src/TwigComponent/src/ComponentFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,3 @@ public function reset(): void
240240
$this->mountMethods = [];
241241
}
242242
}
243-

0 commit comments

Comments
 (0)