1"use strict";(self.webpackChunkkunstmaan_edition=self.webpackChunkkunstmaan_edition||[]).push([[6547],{6547:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{eval('{var leaflet__WEBPACK_IMPORTED_MODULE_1___namespace_cache;\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "default": () => (/* binding */ map_controller_default)\n/* harmony export */ });\n/* harmony import */ var _hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2891);\n/* harmony import */ var leaflet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3481);\n// ../../../../assets/dist/abstract_map_controller.js\n\nvar IconTypes = {\n Url: "url",\n Svg: "svg",\n UxIcon: "ux-icon"\n};\nvar abstract_map_controller_default = class extends _hotwired_stimulus__WEBPACK_IMPORTED_MODULE_0__/* .Controller */ .xI {\n constructor() {\n super(...arguments);\n this.markers = /* @__PURE__ */new Map();\n this.polygons = /* @__PURE__ */new Map();\n this.polylines = /* @__PURE__ */new Map();\n this.circles = /* @__PURE__ */new Map();\n this.rectangles = /* @__PURE__ */new Map();\n this.infoWindows = [];\n this.isConnected = false;\n }\n connect() {\n const extra = this.hasExtraValue ? this.extraValue : {};\n const mapDefinition = {\n center: this.hasCenterValue ? this.centerValue : null,\n zoom: this.hasZoomValue ? this.zoomValue : null,\n minZoom: this.hasMinZoomValue ? this.minZoomValue : null,\n maxZoom: this.hasMaxZoomValue ? this.maxZoomValue : null,\n options: this.optionsValue,\n extra\n };\n this.dispatchEvent("pre-connect", mapDefinition);\n this.createMarker = this.createDrawingFactory("marker", this.markers, this.doCreateMarker.bind(this));\n this.createPolygon = this.createDrawingFactory("polygon", this.polygons, this.doCreatePolygon.bind(this));\n this.createPolyline = this.createDrawingFactory("polyline", this.polylines, this.doCreatePolyline.bind(this));\n this.createCircle = this.createDrawingFactory("circle", this.circles, this.doCreateCircle.bind(this));\n this.createRectangle = this.createDrawingFactory("rectangle", this.rectangles, this.doCreateRectangle.bind(this));\n this.map = this.doCreateMap({\n definition: mapDefinition\n });\n this.markersValue.forEach(definition => this.createMarker({\n definition\n }));\n this.polygonsValue.forEach(definition => this.createPolygon({\n definition\n }));\n this.polylinesValue.forEach(definition => this.createPolyline({\n definition\n }));\n this.circlesValue.forEach(definition => this.createCircle({\n definition\n }));\n this.rectanglesValue.forEach(definition => this.createRectangle({\n definition\n }));\n if (this.fitBoundsToMarkersValue) {\n this.doFitBoundsToMarkers();\n }\n this.dispatchEvent("connect", {\n map: this.map,\n markers: [...this.markers.values()],\n polygons: [...this.polygons.values()],\n polylines: [...this.polylines.values()],\n circles: [...this.circles.values()],\n rectangles: [...this.rectangles.values()],\n infoWindows: this.infoWindows,\n extra\n });\n this.isConnected = true;\n }\n //region Public API\n createInfoWindow({\n definition,\n element\n }) {\n this.dispatchEvent("info-window:before-create", {\n definition,\n element\n });\n const infoWindow = this.doCreateInfoWindow({\n definition,\n element\n });\n this.dispatchEvent("info-window:after-create", {\n infoWindow,\n definition,\n element\n });\n this.infoWindows.push(infoWindow);\n return infoWindow;\n }\n markersValueChanged() {\n if (!this.isConnected) {\n return;\n }\n this.onDrawChanged(this.markers, this.markersValue, this.createMarker, this.doRemoveMarker);\n if (this.fitBoundsToMarkersValue) {\n this.doFitBoundsToMarkers();\n }\n }\n polygonsValueChanged() {\n if (!this.isConnected) {\n return;\n }\n this.onDrawChanged(this.polygons, this.polygonsValue, this.createPolygon, this.doRemovePolygon);\n }\n polylinesValueChanged() {\n if (!this.isConnected) {\n return;\n }\n this.onDrawChanged(this.polylines, this.polylinesValue, this.createPolyline, this.doRemovePolyline);\n }\n circlesValueChanged() {\n if (!this.isConnected) {\n return;\n }\n this.onDrawChanged(this.circles, this.circlesValue, this.createCircle, this.doRemoveCircle);\n }\n rectanglesValueChanged() {\n if (!this.isConnected) {\n return;\n }\n this.onDrawChanged(this.rectangles, this.rectanglesValue, this.createRectangle, this.doRemoveRectangle);\n }\n createDrawingFactory(type, draws, factory) {\n const eventBefore = `${type}:before-create`;\n const eventAfter = `${type}:after-create`;\n return ({\n definition\n }) =>
1 {\n this.dispatchEvent(eventBefore, {\n definition\n });\n if (typeof definition.rawOptions !== "undefined") {\n console.warn(`[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.`, definition);\n }\n const drawing = factory({\n definition\n });\n this.dispatchEvent(eventAfter, {\n [type]: drawing,\n definition\n });\n draws.set(definition["@id"], drawing);\n return drawing;\n };\n }\n onDrawChanged(draws, newDrawDefinitions, factory, remover) {\n const idsToRemove = new Set(draws.keys());\n newDrawDefinitions.forEach(definition => {\n idsToRemove.delete(definition["@id"]);\n });\n idsToRemove.forEach(id => {\n const draw = draws.get(id);\n remover(draw);\n draws.delete(id);\n });\n newDrawDefinitions.forEach(definition => {\n if (!draws.has(definition["@id"])) {\n factory({\n definition\n });\n }\n });\n }\n //endregion\n};\nabstract_map_controller_default.values = {\n providerOptions: Object,\n center: Object,\n zoom: Number,\n minZoom: Number,\n maxZoom: Number,\n fitBoundsToMarkers: Boolean,\n markers: Array,\n polygons: Array,\n polylines: Array,\n circles: Array,\n rectangles: Array,\n options: Object,\n extra: Object\n};\n\n// src/map_controller.ts\n\n\nvar map_controller_default = class extends abstract_map_controller_default {\n connect() {\n leaflet__WEBPACK_IMPORTED_MODULE_1__.Marker.prototype.options.icon = leaflet__WEBPACK_IMPORTED_MODULE_1__.divIcon({\n 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>\',\n iconSize: [25, 41],\n iconAnchor: [12.5, 41],\n popupAnchor: [0, -41],\n className: ""\n // Adding an empty class to the icon to avoid the default Leaflet styles\n });\n super.connect();\n }\n centerValueChanged() {\n if (this.map && this.hasCenterValue && this.centerValue && this.hasZoomValue && this.zoomValue) {\n this.map.setView(this.centerValue, this.zoomValue);\n }\n }\n zoomValueChanged() {\n if (this.map && this.hasZoomValue && this.zoomValue) {\n this.map.setZoom(this.zoomValue);\n }\n }\n minZoomValueChanged() {\n if (this.map && this.hasMinZoomValue && this.minZoomValue) {\n this.map.setMinZoom(this.minZoomValue);\n }\n }\n maxZoomValueChanged() {\n if (this.map && this.hasMaxZoomValue && this.maxZoomValue) {\n this.map.setMaxZoom(this.maxZoomValue);\n }\n }\n dispatchEvent(name, payload = {}) {\n payload.L = /*#__PURE__*/ (leaflet__WEBPACK_IMPORTED_MODULE_1___namespace_cache || (leaflet__WEBPACK_IMPORTED_MODULE_1___namespace_cache = __webpack_require__.t(leaflet__WEBPACK_IMPORTED_MODULE_1__, 2)));\n this.dispatch(name, {\n prefix: "ux:map",\n detail: payload\n });\n }\n doCreateMap({\n definition\n }) {\n const {\n center,\n zoom,\n minZoom,\n maxZoom,\n options,\n bridgeOptions = {}\n } = definition;\n const map2 = leaflet__WEBPACK_IMPORTED_MODULE_1__.map(this.element, {\n center: center === null ? void 0 : center,\n zoom: zoom === null ? void 0 : zoom,\n minZoom: minZoom === null ? void 0 : minZoom,\n maxZoom: maxZoom === null ? void 0 : maxZoom,\n attributionControl: false,\n zoomControl: false,\n ...options,\n ...bridgeOptions\n });\n if (options.tileLayer) {\n leaflet__WEBPACK_IMPORTED_MODULE_1__.tileLayer(options.tileLayer.url, {\n attribution: options.tileLayer.attribution,\n ...options.tileLayer.options\n }).addTo(map2);\n }\n if (typeof options.attributionControlOptions !== "undefined") {\n leaflet__WEBPACK_IMPORTED_MODULE_1__.control.attribution({\n ...options.attributionControlOptions\n }).addTo(map2);\n }\n if (typeof options.zoomControlOptions !== "undefined") {\n leaflet__WEBPACK_IMPORTED_MODULE_1__.control.zoom({\n ...options.zoomControlOptions\n }).addTo(map2);\n }\n return map2;
1\n }\n doCreateMarker({\n definition\n }) {\n const {\n "@id": _id,\n position,\n title,\n infoWindow,\n icon: icon2,\n rawOptions = {},\n bridgeOptions = {}\n } = definition;\n const marker2 = leaflet__WEBPACK_IMPORTED_MODULE_1__.marker(position, {\n title: title || void 0,\n ...rawOptions,\n ...bridgeOptions,\n riseOnHover: true\n }).addTo(this.map);\n if (infoWindow) {\n this.createInfoWindow({\n definition: infoWindow,\n element: marker2\n });\n }\n if (icon2) {\n if (Object.prototype.hasOwnProperty.call(bridgeOptions, "icon")) {\n console.warn(\'[Symfony UX Map] Defining "bridgeOptions.icon" for a marker with a custom icon is not supported and will be ignored.\');\n } else if (Object.prototype.hasOwnProperty.call(rawOptions, "icon")) {\n console.warn(\'[Symfony UX Map] Defining "rawOptions.icon" for a marker with a custom icon is not supported and will be ignored.\');\n }\n this.doCreateIcon({\n definition: icon2,\n element: marker2\n });\n }\n return marker2;\n }\n doRemoveMarker(marker2) {\n marker2.remove();\n }\n doCreatePolygon({\n definition\n }) {\n const {\n "@id": _id,\n points,\n title,\n infoWindow,\n rawOptions = {},\n bridgeOptions = {}\n } = definition;\n const polygon2 = leaflet__WEBPACK_IMPORTED_MODULE_1__.polygon(points, {\n ...rawOptions,\n ...bridgeOptions\n }).addTo(this.map);\n if (title) {\n polygon2.bindPopup(title);\n }
1\n if (infoWindow) {\n this.createInfoWindow({\n definition: infoWindow,\n element: polygon2\n });\n }\n return polygon2;\n }\n doRemovePolygon(polygon2) {\n polygon2.remove();\n }\n doCreatePolyline({\n definition\n }) {\n const {\n "@id": _id,\n points,\n title,\n infoWindow,\n rawOptions = {},\n bridgeOptions = {}\n } = definition;\n const polyline2 = leaflet__WEBPACK_IMPORTED_MODULE_1__.polyline(points, {\n ...rawOptions,\n ...bridgeOptions\n }).addTo(this.map);\n if (title) {\n polyline2.bindPopup(title);\n }\n if (infoWindow) {\n this.createInfoWindow({\n definition: infoWindow,\n element: polyline2\n });\n }\n return polyline2;\n }\n doRemovePolyline(polyline2) {\n polyline2.remove();\n }\n doCreateCircle({\n definition\n }) {\n const {\n "@id": _id,\n center,\n radius,\n title,\n infoWindow,\n rawOptions = {},\n bridgeOptions = {}\n } = definition;\n const circle2 = leaflet__WEBPACK_IMPORTED_MODULE_1__.circle(center, {\n radius,\n ...rawOptions,\n ...bridgeOptions\n }).addTo(this.map);\n if (title) {\n circle2.bindPopup(title);\n }
1\n if (infoWindow) {\n this.createInfoWindow({\n definition: infoWindow,\n element: circle2\n });\n }\n return circle2;\n }\n doRemoveCircle(circle2) {\n circle2.remove();\n }\n doCreateRectangle({\n definition\n }) {\n const {\n "@id": _id,\n southWest,\n northEast,\n title,\n infoWindow,\n rawOptions = {},\n bridgeOptions = {}\n } = definition;\n const rectangle2 = leaflet__WEBPACK_IMPORTED_MODULE_1__.rectangle([[southWest.lat, southWest.lng], [northEast.lat, northEast.lng]], {\n ...rawOptions,\n ...bridgeOptions\n }).addTo(this.map);\n if (title) {\n rectangle2.bindPopup(title);\n }\n if (infoWindow) {\n this.createInfoWindow({\n definition: infoWindow,\n element: rectangle2\n });\n }\n return rectangle2;\n }\n doRemoveRectangle(rectangle2) {\n rectangle2.remove();\n }\n doCreateInfoWindow({\n definition,\n element\n }) {\n const {\n headerContent,\n content,\n opened,\n autoClose,\n rawOptions = {},\n bridgeOptions = {}\n } = definition;\n element.bindPopup([headerContent, content].filter(x => x).join("<br>"), {\n ...rawOptions,\n ...bridgeOptions\n });\n if (opened) {\n if (autoClose) {\n this.closePopups();\n }\n setTimeout(() => element.openPopup(), 0);\n }\n const popup = element.getPopup();\n if (!popup) {\n throw new Error("Unable to get the Popup associated with the element.");\n }\n popup.on("click", () => {\n if (autoClose) {\n this.closePopups({\n except: popup\n });\n }\n });\n return popup;\n }\n doCreateIcon({\n definition,\n element\n }) {\n const {\n type,\n width,\n height\n } = definition;\n let icon2;\n if (type === IconTypes.Svg) {\n icon2 = leaflet__WEBPACK_IMPORTED_MODULE_1__.divIcon({\n html: definition.html,\n iconSize: [width, height],\n className: ""\n // Adding an empty class to the icon to avoid the default Leaflet styles\n });\n } else if (type === IconTypes.UxIcon) {\n icon2 = leaflet__WEBPACK_IMPORTED_MODULE_1__.divIcon({\n html: definition._generated_html,\n iconSize: [width, height],\n className: ""\n // Adding an empty class to the icon to avoid the default Leaflet styles\n });\n } else if (type === IconTypes.Url) {\n icon2 = leaflet__WEBPACK_IMPORTED_MODULE_1__.icon({\n iconUrl: definition.url,\n iconSize: [width, height],\n className: ""\n // Adding an empty class to the icon to avoid the default Leaflet styles\n });\n } else {\n throw new Error(`Unsupported icon type: ${type}.`);\n }\n element.setIcon(icon2);\n }\n doFitBoundsToMarkers() {\n if (this.markers.size === 0) {\n return;\n }\n const bounds = [];\n this.markers.forEach(marker2 => {\n const position = marker2.getLatLng();\n bounds.push([position.lat, position.lng]);\n });\n this.map.fitBounds(bounds);\n }\n closePopups(options = {}) {\n this.infoWindows.forEach(popup => {\n if (options.except && popup === options.except) {\n return;\n }\n popup.close();\n });\n }\n};\n\n\n//# sourceURL=webpack://kunstmaan-edition/./vendor/symfony/ux-leaflet-map/assets/dist/map_controller.js?\n}')}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.