@datagouv/components-next 0.2.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/assets/main.css +49 -22
- package/dist/Control-BNCDn-8E.js +148 -0
- package/dist/{Datafair.client-x39O4yfF.js → Datafair.client-B5lBpOl8.js} +2 -2
- package/dist/Event-BOgJUhNR.js +738 -0
- package/dist/Image-BN-4XkIn.js +247 -0
- package/dist/{JsonPreview.client-BMsC5JcY.js → JsonPreview.client-Doz1Z0BS.js} +23 -23
- package/dist/Map-BdT3i2C4.js +7609 -0
- package/dist/MapContainer.client-oiieO8H-.js +105 -0
- package/dist/OSM-CamriM9b.js +71 -0
- package/dist/PdfPreview.client-CdAhkDFJ.js +14513 -0
- package/dist/{Pmtiles.client-BaiIo4VZ.js → Pmtiles.client-B0v8tGJQ.js} +3 -3
- package/dist/ScaleLine-BiesrgOv.js +165 -0
- package/dist/Swagger.client-CsK65JnG.js +4 -0
- package/dist/Tile-DCuqwNOI.js +1206 -0
- package/dist/TileImage-CmZf8EdU.js +1067 -0
- package/dist/View-DcDc7N2K.js +2858 -0
- package/dist/{XmlPreview.client-CAdN0w_Y.js → XmlPreview.client-CrjHf74q.js} +17 -17
- package/dist/common-C4rDcQpp.js +243 -0
- package/dist/components-next.css +1 -1
- package/dist/components-next.js +158 -117
- package/dist/components.css +1 -1
- package/dist/{MapContainer.client-DeSo8EvG.js → index-Bbu9rOHt.js} +4975 -21416
- package/dist/leaflet-src-7m1mB8LI.js +6338 -0
- package/dist/{main-Dgri3TQL.js → main-CiH8ZmBI.js} +56973 -51462
- package/dist/proj-CKwYjU38.js +1569 -0
- package/dist/tilecoord-YW3qEH_j.js +884 -0
- package/dist/{vue3-xml-viewer.common-D6skc_Ai.js → vue3-xml-viewer.common-Bi_bsV6C.js} +1 -1
- package/package.json +6 -2
- package/src/components/ActivityList/ActivityList.vue +6 -2
- package/src/components/AppLink.vue +4 -1
- package/src/components/Avatar.vue +2 -2
- package/src/components/AvatarWithName.vue +8 -4
- package/src/components/BouncingDots.vue +21 -0
- package/src/components/BrandedButton.vue +2 -0
- package/src/components/CopyButton.vue +19 -7
- package/src/components/DataserviceCard.vue +85 -120
- package/src/components/DatasetCard.vue +110 -171
- package/src/components/DatasetInformation/DatasetEmbedSection.vue +43 -0
- package/src/components/DatasetInformation/DatasetInformationSection.vue +73 -0
- package/src/components/DatasetInformation/DatasetSchemaSection.vue +74 -0
- package/src/components/DatasetInformation/DatasetSpatialSection.vue +59 -0
- package/src/components/DatasetInformation/DatasetTemporalitySection.vue +45 -0
- package/src/components/DatasetInformation/index.ts +5 -0
- package/src/components/DatasetQuality.vue +23 -16
- package/src/components/DatasetQualityInline.vue +13 -17
- package/src/components/DatasetQualityScore.vue +12 -15
- package/src/components/DatasetQualityTooltipContent.vue +3 -3
- package/src/components/DescriptionList.vue +1 -4
- package/src/components/DescriptionListDetails.vue +5 -0
- package/src/components/DescriptionListTerm.vue +5 -0
- package/src/components/DiscussionMessageCard.vue +63 -0
- package/src/components/ExtraAccordion.vue +4 -4
- package/src/components/Form/BadgeSelect.vue +35 -0
- package/src/components/Form/FormatSelect.vue +28 -0
- package/src/components/Form/GeozoneSelect.vue +52 -0
- package/src/components/Form/GranularitySelect.vue +29 -0
- package/src/components/Form/LicenseSelect.vue +30 -0
- package/src/components/Form/OrganizationSelect.vue +62 -0
- package/src/components/Form/OrganizationTypeSelect.vue +34 -0
- package/src/components/Form/ReuseTopicSelect.vue +29 -0
- package/src/components/Form/SchemaSelect.vue +30 -0
- package/src/components/Form/SearchableSelect.vue +334 -0
- package/src/components/Form/SelectGroup.vue +132 -0
- package/src/components/Form/TagSelect.vue +38 -0
- package/src/components/LeafletMap.vue +31 -0
- package/src/components/LicenseBadge.vue +24 -0
- package/src/components/LoadingBlock.vue +23 -2
- package/src/components/MarkdownViewer.vue +3 -1
- package/src/components/ObjectCard.vue +42 -0
- package/src/components/ObjectCardBadge.vue +22 -0
- package/src/components/ObjectCardHeader.vue +35 -0
- package/src/components/ObjectCardOwner.vue +43 -0
- package/src/components/ObjectCardShortDescription.vue +28 -0
- package/src/components/OrganizationCard.vue +35 -20
- package/src/components/OrganizationHorizontalCard.vue +87 -0
- package/src/components/OrganizationLogo.vue +1 -1
- package/src/components/OrganizationNameWithCertificate.vue +12 -6
- package/src/components/OwnerTypeIcon.vue +1 -0
- package/src/components/Pagination.vue +1 -1
- package/src/components/Placeholder.vue +5 -2
- package/src/components/PostCard.vue +62 -0
- package/src/components/ProgressBar.vue +31 -0
- package/src/components/RadioGroup.vue +32 -0
- package/src/components/RadioInput.vue +64 -0
- package/src/components/ResourceAccordion/Datafair.client.vue +1 -1
- package/src/components/ResourceAccordion/EditButton.vue +2 -3
- package/src/components/ResourceAccordion/JsonPreview.client.vue +3 -3
- package/src/components/ResourceAccordion/MapContainer.client.vue +21 -17
- package/src/components/ResourceAccordion/Metadata.vue +11 -24
- package/src/components/ResourceAccordion/PdfPreview.client.vue +70 -74
- package/src/components/ResourceAccordion/Pmtiles.client.vue +2 -2
- package/src/components/ResourceAccordion/Preview.vue +2 -2
- package/src/components/ResourceAccordion/ResourceAccordion.vue +35 -28
- package/src/components/ResourceAccordion/ResourceIcon.vue +1 -0
- package/src/components/ResourceAccordion/SchemaBadge.vue +2 -2
- package/src/components/ResourceAccordion/XmlPreview.client.vue +3 -3
- package/src/components/ResourceExplorer/ResourceExplorer.vue +243 -0
- package/src/components/ResourceExplorer/ResourceExplorerSidebar.vue +116 -0
- package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +410 -0
- package/src/components/ReuseCard.vue +8 -28
- package/src/components/ReuseHorizontalCard.vue +80 -0
- package/src/components/Search/BasicAndAdvancedFilters.vue +49 -0
- package/src/components/Search/Filter/AccessTypeFilter.vue +37 -0
- package/src/components/Search/Filter/DatasetBadgeFilter.vue +40 -0
- package/src/components/Search/Filter/FilterButtonGroup.vue +78 -0
- package/src/components/Search/Filter/FormatFamilyFilter.vue +39 -0
- package/src/components/Search/Filter/LastUpdateRangeFilter.vue +37 -0
- package/src/components/Search/Filter/ProducerTypeFilter.vue +49 -0
- package/src/components/Search/Filter/ReuseTypeFilter.vue +42 -0
- package/src/components/Search/GlobalSearch.vue +707 -0
- package/src/components/Search/SearchInput.vue +63 -0
- package/src/components/Search/Sidemenu.vue +38 -0
- package/src/components/StatBox.vue +5 -5
- package/src/components/Tag.vue +30 -0
- package/src/components/Toggletip.vue +11 -4
- package/src/components/Tooltip.vue +2 -3
- package/src/components/TopicCard.vue +134 -0
- package/src/components/radioGroupContext.ts +9 -0
- package/src/composables/useDebouncedRef.ts +31 -0
- package/src/composables/useHasTabularData.ts +15 -0
- package/src/composables/useMetrics.ts +4 -3
- package/src/composables/useResourceCapabilities.ts +131 -0
- package/src/composables/useRouteQueryBoolean.ts +10 -0
- package/src/composables/useSelectModelSync.ts +89 -0
- package/src/composables/useStableQueryParams.ts +84 -0
- package/src/composables/useTranslation.ts +2 -1
- package/src/config.ts +4 -0
- package/src/functions/api.ts +25 -6
- package/src/functions/api.types.ts +5 -3
- package/src/functions/datasets.ts +1 -29
- package/src/functions/description.ts +33 -0
- package/src/functions/helpers.ts +11 -0
- package/src/functions/markdown.ts +60 -16
- package/src/functions/metrics.ts +33 -0
- package/src/functions/organizations.ts +5 -5
- package/src/functions/resourceCapabilities.ts +55 -0
- package/src/main.ts +96 -7
- package/src/types/dataservices.ts +14 -12
- package/src/types/datasets.ts +20 -7
- package/src/types/discussions.ts +20 -0
- package/src/types/licenses.ts +3 -3
- package/src/types/organizations.ts +13 -1
- package/src/types/owned.ts +4 -2
- package/src/types/pages.ts +70 -0
- package/src/types/posts.ts +27 -0
- package/src/types/resources.ts +16 -0
- package/src/types/reuses.ts +14 -5
- package/src/types/search.ts +407 -0
- package/src/types/users.ts +12 -3
- package/dist/PdfPreview.client-COOkEkRA.js +0 -107
- package/dist/Swagger.client-CpLgaLg6.js +0 -4
- package/dist/pdf-vue3-IkJO65RH.js +0 -273
- package/dist/pdf.min-f72cfa08-CdgJTooZ.js +0 -9501
- package/src/components/DatasetInformationPanel.vue +0 -211
|
@@ -0,0 +1,738 @@
|
|
|
1
|
+
import { H as x } from "./View-DcDc7N2K.js";
|
|
2
|
+
import { a as I } from "./common-C4rDcQpp.js";
|
|
3
|
+
import { B as C, a6 as h, ak as m, u as S, l as p, E as N, i as L, a3 as P, I as Z } from "./proj-CKwYjU38.js";
|
|
4
|
+
import { c as T } from "./Image-BN-4XkIn.js";
|
|
5
|
+
const n = {
|
|
6
|
+
OPACITY: "opacity",
|
|
7
|
+
VISIBLE: "visible",
|
|
8
|
+
EXTENT: "extent",
|
|
9
|
+
Z_INDEX: "zIndex",
|
|
10
|
+
MAX_RESOLUTION: "maxResolution",
|
|
11
|
+
MIN_RESOLUTION: "minResolution",
|
|
12
|
+
MAX_ZOOM: "maxZoom",
|
|
13
|
+
MIN_ZOOM: "minZoom",
|
|
14
|
+
SOURCE: "source",
|
|
15
|
+
MAP: "map"
|
|
16
|
+
};
|
|
17
|
+
class D extends C {
|
|
18
|
+
/**
|
|
19
|
+
* @param {Options} options Layer options.
|
|
20
|
+
*/
|
|
21
|
+
constructor(e) {
|
|
22
|
+
super(), this.on, this.once, this.un, this.background_ = e.background;
|
|
23
|
+
const r = Object.assign({}, e);
|
|
24
|
+
typeof e.properties == "object" && (delete r.properties, Object.assign(r, e.properties)), r[n.OPACITY] = e.opacity !== void 0 ? e.opacity : 1, I(
|
|
25
|
+
typeof r[n.OPACITY] == "number",
|
|
26
|
+
"Layer opacity must be a number"
|
|
27
|
+
), r[n.VISIBLE] = e.visible !== void 0 ? e.visible : !0, r[n.Z_INDEX] = e.zIndex, r[n.MAX_RESOLUTION] = e.maxResolution !== void 0 ? e.maxResolution : 1 / 0, r[n.MIN_RESOLUTION] = e.minResolution !== void 0 ? e.minResolution : 0, r[n.MIN_ZOOM] = e.minZoom !== void 0 ? e.minZoom : -1 / 0, r[n.MAX_ZOOM] = e.maxZoom !== void 0 ? e.maxZoom : 1 / 0, this.className_ = r.className !== void 0 ? r.className : "ol-layer", delete r.className, this.setProperties(r), this.state_ = null;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get the background for this layer.
|
|
31
|
+
* @return {BackgroundColor|false} Layer background.
|
|
32
|
+
*/
|
|
33
|
+
getBackground() {
|
|
34
|
+
return this.background_;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @return {string} CSS class name.
|
|
38
|
+
*/
|
|
39
|
+
getClassName() {
|
|
40
|
+
return this.className_;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* This method is not meant to be called by layers or layer renderers because the state
|
|
44
|
+
* is incorrect if the layer is included in a layer group.
|
|
45
|
+
*
|
|
46
|
+
* @param {boolean} [managed] Layer is managed.
|
|
47
|
+
* @return {import("./Layer.js").State} Layer state.
|
|
48
|
+
*/
|
|
49
|
+
getLayerState(e) {
|
|
50
|
+
const r = this.state_ || /** @type {?} */
|
|
51
|
+
{
|
|
52
|
+
layer: this,
|
|
53
|
+
managed: e === void 0 ? !0 : e
|
|
54
|
+
}, s = this.getZIndex();
|
|
55
|
+
return r.opacity = h(Math.round(this.getOpacity() * 100) / 100, 0, 1), r.visible = this.getVisible(), r.extent = this.getExtent(), r.zIndex = s === void 0 && !r.managed ? 1 / 0 : s, r.maxResolution = this.getMaxResolution(), r.minResolution = Math.max(this.getMinResolution(), 0), r.minZoom = this.getMinZoom(), r.maxZoom = this.getMaxZoom(), this.state_ = r, r;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @abstract
|
|
59
|
+
* @param {Array<import("./Layer.js").default>} [array] Array of layers (to be
|
|
60
|
+
* modified in place).
|
|
61
|
+
* @return {Array<import("./Layer.js").default>} Array of layers.
|
|
62
|
+
*/
|
|
63
|
+
getLayersArray(e) {
|
|
64
|
+
return m();
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @abstract
|
|
68
|
+
* @param {Array<import("./Layer.js").State>} [states] Optional list of layer
|
|
69
|
+
* states (to be modified in place).
|
|
70
|
+
* @return {Array<import("./Layer.js").State>} List of layer states.
|
|
71
|
+
*/
|
|
72
|
+
getLayerStatesArray(e) {
|
|
73
|
+
return m();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Return the {@link module:ol/extent~Extent extent} of the layer or `undefined` if it
|
|
77
|
+
* will be visible regardless of extent.
|
|
78
|
+
* @return {import("../extent.js").Extent|undefined} The layer extent.
|
|
79
|
+
* @observable
|
|
80
|
+
* @api
|
|
81
|
+
*/
|
|
82
|
+
getExtent() {
|
|
83
|
+
return (
|
|
84
|
+
/** @type {import("../extent.js").Extent|undefined} */
|
|
85
|
+
this.get(n.EXTENT)
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Return the maximum resolution of the layer. Returns Infinity if
|
|
90
|
+
* the layer has no maximum resolution set.
|
|
91
|
+
* @return {number} The maximum resolution of the layer.
|
|
92
|
+
* @observable
|
|
93
|
+
* @api
|
|
94
|
+
*/
|
|
95
|
+
getMaxResolution() {
|
|
96
|
+
return (
|
|
97
|
+
/** @type {number} */
|
|
98
|
+
this.get(n.MAX_RESOLUTION)
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Return the minimum resolution of the layer. Returns 0 if
|
|
103
|
+
* the layer has no minimum resolution set.
|
|
104
|
+
* @return {number} The minimum resolution of the layer.
|
|
105
|
+
* @observable
|
|
106
|
+
* @api
|
|
107
|
+
*/
|
|
108
|
+
getMinResolution() {
|
|
109
|
+
return (
|
|
110
|
+
/** @type {number} */
|
|
111
|
+
this.get(n.MIN_RESOLUTION)
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Return the minimum zoom level of the layer. Returns -Infinity if
|
|
116
|
+
* the layer has no minimum zoom set.
|
|
117
|
+
* @return {number} The minimum zoom level of the layer.
|
|
118
|
+
* @observable
|
|
119
|
+
* @api
|
|
120
|
+
*/
|
|
121
|
+
getMinZoom() {
|
|
122
|
+
return (
|
|
123
|
+
/** @type {number} */
|
|
124
|
+
this.get(n.MIN_ZOOM)
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Return the maximum zoom level of the layer. Returns Infinity if
|
|
129
|
+
* the layer has no maximum zoom set.
|
|
130
|
+
* @return {number} The maximum zoom level of the layer.
|
|
131
|
+
* @observable
|
|
132
|
+
* @api
|
|
133
|
+
*/
|
|
134
|
+
getMaxZoom() {
|
|
135
|
+
return (
|
|
136
|
+
/** @type {number} */
|
|
137
|
+
this.get(n.MAX_ZOOM)
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Return the opacity of the layer (between 0 and 1).
|
|
142
|
+
* @return {number} The opacity of the layer.
|
|
143
|
+
* @observable
|
|
144
|
+
* @api
|
|
145
|
+
*/
|
|
146
|
+
getOpacity() {
|
|
147
|
+
return (
|
|
148
|
+
/** @type {number} */
|
|
149
|
+
this.get(n.OPACITY)
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* @abstract
|
|
154
|
+
* @return {import("../source/Source.js").State} Source state.
|
|
155
|
+
*/
|
|
156
|
+
getSourceState() {
|
|
157
|
+
return m();
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Return the value of this layer's `visible` property. To find out whether the layer
|
|
161
|
+
* is visible on a map, use `isVisible()` instead.
|
|
162
|
+
* @return {boolean} The value of the `visible` property of the layer.
|
|
163
|
+
* @observable
|
|
164
|
+
* @api
|
|
165
|
+
*/
|
|
166
|
+
getVisible() {
|
|
167
|
+
return (
|
|
168
|
+
/** @type {boolean} */
|
|
169
|
+
this.get(n.VISIBLE)
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Return the Z-index of the layer, which is used to order layers before
|
|
174
|
+
* rendering. Returns undefined if the layer is unmanaged.
|
|
175
|
+
* @return {number|undefined} The Z-index of the layer.
|
|
176
|
+
* @observable
|
|
177
|
+
* @api
|
|
178
|
+
*/
|
|
179
|
+
getZIndex() {
|
|
180
|
+
return (
|
|
181
|
+
/** @type {number|undefined} */
|
|
182
|
+
this.get(n.Z_INDEX)
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Sets the background color.
|
|
187
|
+
* @param {BackgroundColor} [background] Background color.
|
|
188
|
+
*/
|
|
189
|
+
setBackground(e) {
|
|
190
|
+
this.background_ = e, this.changed();
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Set the extent at which the layer is visible. If `undefined`, the layer
|
|
194
|
+
* will be visible at all extents.
|
|
195
|
+
* @param {import("../extent.js").Extent|undefined} extent The extent of the layer.
|
|
196
|
+
* @observable
|
|
197
|
+
* @api
|
|
198
|
+
*/
|
|
199
|
+
setExtent(e) {
|
|
200
|
+
this.set(n.EXTENT, e);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Set the maximum resolution at which the layer is visible.
|
|
204
|
+
* @param {number} maxResolution The maximum resolution of the layer.
|
|
205
|
+
* @observable
|
|
206
|
+
* @api
|
|
207
|
+
*/
|
|
208
|
+
setMaxResolution(e) {
|
|
209
|
+
this.set(n.MAX_RESOLUTION, e);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Set the minimum resolution at which the layer is visible.
|
|
213
|
+
* @param {number} minResolution The minimum resolution of the layer.
|
|
214
|
+
* @observable
|
|
215
|
+
* @api
|
|
216
|
+
*/
|
|
217
|
+
setMinResolution(e) {
|
|
218
|
+
this.set(n.MIN_RESOLUTION, e);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Set the maximum zoom (exclusive) at which the layer is visible.
|
|
222
|
+
* Note that the zoom levels for layer visibility are based on the
|
|
223
|
+
* view zoom level, which may be different from a tile source zoom level.
|
|
224
|
+
* @param {number} maxZoom The maximum zoom of the layer.
|
|
225
|
+
* @observable
|
|
226
|
+
* @api
|
|
227
|
+
*/
|
|
228
|
+
setMaxZoom(e) {
|
|
229
|
+
this.set(n.MAX_ZOOM, e);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Set the minimum zoom (inclusive) at which the layer is visible.
|
|
233
|
+
* Note that the zoom levels for layer visibility are based on the
|
|
234
|
+
* view zoom level, which may be different from a tile source zoom level.
|
|
235
|
+
* @param {number} minZoom The minimum zoom of the layer.
|
|
236
|
+
* @observable
|
|
237
|
+
* @api
|
|
238
|
+
*/
|
|
239
|
+
setMinZoom(e) {
|
|
240
|
+
this.set(n.MIN_ZOOM, e);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Set the opacity of the layer, allowed values range from 0 to 1.
|
|
244
|
+
* @param {number} opacity The opacity of the layer.
|
|
245
|
+
* @observable
|
|
246
|
+
* @api
|
|
247
|
+
*/
|
|
248
|
+
setOpacity(e) {
|
|
249
|
+
I(typeof e == "number", "Layer opacity must be a number"), this.set(n.OPACITY, e);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Set the visibility of the layer (`true` or `false`).
|
|
253
|
+
* @param {boolean} visible The visibility of the layer.
|
|
254
|
+
* @observable
|
|
255
|
+
* @api
|
|
256
|
+
*/
|
|
257
|
+
setVisible(e) {
|
|
258
|
+
this.set(n.VISIBLE, e);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Set Z-index of the layer, which is used to order layers before rendering.
|
|
262
|
+
* The default Z-index is 0.
|
|
263
|
+
* @param {number} zindex The z-index of the layer.
|
|
264
|
+
* @observable
|
|
265
|
+
* @api
|
|
266
|
+
*/
|
|
267
|
+
setZIndex(e) {
|
|
268
|
+
this.set(n.Z_INDEX, e);
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Clean up.
|
|
272
|
+
* @override
|
|
273
|
+
*/
|
|
274
|
+
disposeInternal() {
|
|
275
|
+
this.state_ && (this.state_.layer = null, this.state_ = null), super.disposeInternal();
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
const K = {
|
|
279
|
+
/**
|
|
280
|
+
* Triggered before a layer is rendered.
|
|
281
|
+
* @event module:ol/render/Event~RenderEvent#prerender
|
|
282
|
+
* @api
|
|
283
|
+
*/
|
|
284
|
+
PRERENDER: "prerender",
|
|
285
|
+
/**
|
|
286
|
+
* Triggered after a layer is rendered.
|
|
287
|
+
* @event module:ol/render/Event~RenderEvent#postrender
|
|
288
|
+
* @api
|
|
289
|
+
*/
|
|
290
|
+
POSTRENDER: "postrender",
|
|
291
|
+
/**
|
|
292
|
+
* Triggered before layers are composed. When dispatched by the map, the event object will not have
|
|
293
|
+
* a `context` set. When dispatched by a layer, the event object will have a `context` set. Only
|
|
294
|
+
* WebGL layers currently dispatch this event.
|
|
295
|
+
* @event module:ol/render/Event~RenderEvent#precompose
|
|
296
|
+
* @api
|
|
297
|
+
*/
|
|
298
|
+
PRECOMPOSE: "precompose",
|
|
299
|
+
/**
|
|
300
|
+
* Triggered after layers are composed. When dispatched by the map, the event object will not have
|
|
301
|
+
* a `context` set. When dispatched by a layer, the event object will have a `context` set. Only
|
|
302
|
+
* WebGL layers currently dispatch this event.
|
|
303
|
+
* @event module:ol/render/Event~RenderEvent#postcompose
|
|
304
|
+
* @api
|
|
305
|
+
*/
|
|
306
|
+
POSTCOMPOSE: "postcompose",
|
|
307
|
+
/**
|
|
308
|
+
* Triggered when rendering is complete, i.e. all sources and tiles have
|
|
309
|
+
* finished loading for the current viewport, and all tiles are faded in.
|
|
310
|
+
* The event object will not have a `context` set.
|
|
311
|
+
* @event module:ol/render/Event~RenderEvent#rendercomplete
|
|
312
|
+
* @api
|
|
313
|
+
*/
|
|
314
|
+
RENDERCOMPLETE: "rendercomplete"
|
|
315
|
+
};
|
|
316
|
+
class G extends D {
|
|
317
|
+
/**
|
|
318
|
+
* @param {Options<SourceType>} options Layer options.
|
|
319
|
+
*/
|
|
320
|
+
constructor(e) {
|
|
321
|
+
const r = Object.assign({}, e);
|
|
322
|
+
delete r.source, super(r), this.on, this.once, this.un, this.mapPrecomposeKey_ = null, this.mapRenderKey_ = null, this.sourceChangeKey_ = null, this.renderer_ = null, this.sourceReady_ = !1, this.rendered = !1, e.render && (this.render = e.render), e.map && this.setMap(e.map), this.addChangeListener(
|
|
323
|
+
n.SOURCE,
|
|
324
|
+
this.handleSourcePropertyChange_
|
|
325
|
+
);
|
|
326
|
+
const s = e.source ? (
|
|
327
|
+
/** @type {SourceType} */
|
|
328
|
+
e.source
|
|
329
|
+
) : null;
|
|
330
|
+
this.setSource(s);
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* @param {Array<import("./Layer.js").default>} [array] Array of layers (to be modified in place).
|
|
334
|
+
* @return {Array<import("./Layer.js").default>} Array of layers.
|
|
335
|
+
* @override
|
|
336
|
+
*/
|
|
337
|
+
getLayersArray(e) {
|
|
338
|
+
return e = e || [], e.push(this), e;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* @param {Array<import("./Layer.js").State>} [states] Optional list of layer states (to be modified in place).
|
|
342
|
+
* @return {Array<import("./Layer.js").State>} List of layer states.
|
|
343
|
+
* @override
|
|
344
|
+
*/
|
|
345
|
+
getLayerStatesArray(e) {
|
|
346
|
+
return e = e || [], e.push(this.getLayerState()), e;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Get the layer source.
|
|
350
|
+
* @return {SourceType|null} The layer source (or `null` if not yet set).
|
|
351
|
+
* @observable
|
|
352
|
+
* @api
|
|
353
|
+
*/
|
|
354
|
+
getSource() {
|
|
355
|
+
return (
|
|
356
|
+
/** @type {SourceType} */
|
|
357
|
+
this.get(n.SOURCE) || null
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* @return {SourceType|null} The source being rendered.
|
|
362
|
+
*/
|
|
363
|
+
getRenderSource() {
|
|
364
|
+
return this.getSource();
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* @return {import("../source/Source.js").State} Source state.
|
|
368
|
+
* @override
|
|
369
|
+
*/
|
|
370
|
+
getSourceState() {
|
|
371
|
+
const e = this.getSource();
|
|
372
|
+
return e ? e.getState() : "undefined";
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* @private
|
|
376
|
+
*/
|
|
377
|
+
handleSourceChange_() {
|
|
378
|
+
this.changed(), !(this.sourceReady_ || this.getSource().getState() !== "ready") && (this.sourceReady_ = !0, this.dispatchEvent("sourceready"));
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* @private
|
|
382
|
+
*/
|
|
383
|
+
handleSourcePropertyChange_() {
|
|
384
|
+
this.sourceChangeKey_ && (S(this.sourceChangeKey_), this.sourceChangeKey_ = null), this.sourceReady_ = !1;
|
|
385
|
+
const e = this.getSource();
|
|
386
|
+
e && (this.sourceChangeKey_ = p(
|
|
387
|
+
e,
|
|
388
|
+
N.CHANGE,
|
|
389
|
+
this.handleSourceChange_,
|
|
390
|
+
this
|
|
391
|
+
), e.getState() === "ready" && (this.sourceReady_ = !0, setTimeout(() => {
|
|
392
|
+
this.dispatchEvent("sourceready");
|
|
393
|
+
}, 0))), this.changed();
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* @param {import("../pixel").Pixel} pixel Pixel.
|
|
397
|
+
* @return {Promise<Array<import("../Feature").FeatureLike>>} Promise that resolves with
|
|
398
|
+
* an array of features.
|
|
399
|
+
*/
|
|
400
|
+
getFeatures(e) {
|
|
401
|
+
return this.renderer_ ? this.renderer_.getFeatures(e) : Promise.resolve([]);
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* @param {import("../pixel").Pixel} pixel Pixel.
|
|
405
|
+
* @return {Uint8ClampedArray|Uint8Array|Float32Array|DataView|null} Pixel data.
|
|
406
|
+
*/
|
|
407
|
+
getData(e) {
|
|
408
|
+
return !this.renderer_ || !this.rendered ? null : this.renderer_.getData(e);
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* The layer is visible on the map view, i.e. within its min/max resolution or zoom and
|
|
412
|
+
* extent, not set to `visible: false`, and not inside a layer group that is set
|
|
413
|
+
* to `visible: false`.
|
|
414
|
+
* @param {View|import("../View.js").ViewStateLayerStateExtent} [view] View or {@link import("../Map.js").FrameState}.
|
|
415
|
+
* Only required when the layer is not added to a map.
|
|
416
|
+
* @return {boolean} The layer is visible in the map view.
|
|
417
|
+
* @api
|
|
418
|
+
*/
|
|
419
|
+
isVisible(e) {
|
|
420
|
+
let r;
|
|
421
|
+
const s = this.getMapInternal();
|
|
422
|
+
!e && s && (e = s.getView()), e instanceof x ? r = {
|
|
423
|
+
viewState: e.getState(),
|
|
424
|
+
extent: e.calculateExtent()
|
|
425
|
+
} : r = e, !r.layerStatesArray && s && (r.layerStatesArray = s.getLayerGroup().getLayerStatesArray());
|
|
426
|
+
let i;
|
|
427
|
+
if (r.layerStatesArray) {
|
|
428
|
+
if (i = r.layerStatesArray.find(
|
|
429
|
+
(o) => o.layer === this
|
|
430
|
+
), !i)
|
|
431
|
+
return !1;
|
|
432
|
+
} else
|
|
433
|
+
i = this.getLayerState();
|
|
434
|
+
const a = this.getExtent();
|
|
435
|
+
return X(i, r.viewState) && (!a || L(a, r.extent));
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Get the attributions of the source of this layer for the given view.
|
|
439
|
+
* @param {View|import("../View.js").ViewStateLayerStateExtent} [view] View or {@link import("../Map.js").FrameState}.
|
|
440
|
+
* Only required when the layer is not added to a map.
|
|
441
|
+
* @return {Array<string>} Attributions for this layer at the given view.
|
|
442
|
+
* @api
|
|
443
|
+
*/
|
|
444
|
+
getAttributions(e) {
|
|
445
|
+
if (!this.isVisible(e))
|
|
446
|
+
return [];
|
|
447
|
+
const r = this.getSource()?.getAttributions();
|
|
448
|
+
if (!r)
|
|
449
|
+
return [];
|
|
450
|
+
const s = e instanceof x ? e.getViewStateAndExtent() : e;
|
|
451
|
+
let i = r(s);
|
|
452
|
+
return Array.isArray(i) || (i = [i]), i;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* In charge to manage the rendering of the layer. One layer type is
|
|
456
|
+
* bounded with one layer renderer.
|
|
457
|
+
* @param {?import("../Map.js").FrameState} frameState Frame state.
|
|
458
|
+
* @param {HTMLElement} target Target which the renderer may (but need not) use
|
|
459
|
+
* for rendering its content.
|
|
460
|
+
* @return {HTMLElement|null} The rendered element.
|
|
461
|
+
*/
|
|
462
|
+
render(e, r) {
|
|
463
|
+
const s = this.getRenderer();
|
|
464
|
+
return s.prepareFrame(e) ? (this.rendered = !0, s.renderFrame(e, r)) : null;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Called when a layer is not visible during a map render.
|
|
468
|
+
*/
|
|
469
|
+
unrender() {
|
|
470
|
+
this.rendered = !1;
|
|
471
|
+
}
|
|
472
|
+
/** @return {string} Declutter */
|
|
473
|
+
getDeclutter() {
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* @param {import("../Map.js").FrameState} frameState Frame state.
|
|
477
|
+
* @param {import("../layer/Layer.js").State} layerState Layer state.
|
|
478
|
+
*/
|
|
479
|
+
renderDeclutter(e, r) {
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* When the renderer follows a layout -> render approach, do the final rendering here.
|
|
483
|
+
* @param {import('../Map.js').FrameState} frameState Frame state
|
|
484
|
+
*/
|
|
485
|
+
renderDeferred(e) {
|
|
486
|
+
const r = this.getRenderer();
|
|
487
|
+
r && r.renderDeferred(e);
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* For use inside the library only.
|
|
491
|
+
* @param {import("../Map.js").default|null} map Map.
|
|
492
|
+
*/
|
|
493
|
+
setMapInternal(e) {
|
|
494
|
+
e || this.unrender(), this.set(n.MAP, e);
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* For use inside the library only.
|
|
498
|
+
* @return {import("../Map.js").default|null} Map.
|
|
499
|
+
*/
|
|
500
|
+
getMapInternal() {
|
|
501
|
+
return this.get(n.MAP);
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Sets the layer to be rendered on top of other layers on a map. The map will
|
|
505
|
+
* not manage this layer in its layers collection. This
|
|
506
|
+
* is useful for temporary layers. To remove an unmanaged layer from the map,
|
|
507
|
+
* use `#setMap(null)`.
|
|
508
|
+
*
|
|
509
|
+
* To add the layer to a map and have it managed by the map, use
|
|
510
|
+
* {@link module:ol/Map~Map#addLayer} instead.
|
|
511
|
+
* @param {import("../Map.js").default|null} map Map.
|
|
512
|
+
* @api
|
|
513
|
+
*/
|
|
514
|
+
setMap(e) {
|
|
515
|
+
this.mapPrecomposeKey_ && (S(this.mapPrecomposeKey_), this.mapPrecomposeKey_ = null), e || this.changed(), this.mapRenderKey_ && (S(this.mapRenderKey_), this.mapRenderKey_ = null), e && (this.mapPrecomposeKey_ = p(
|
|
516
|
+
e,
|
|
517
|
+
K.PRECOMPOSE,
|
|
518
|
+
this.handlePrecompose_,
|
|
519
|
+
this
|
|
520
|
+
), this.mapRenderKey_ = p(this, N.CHANGE, e.render, e), this.changed());
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* @param {import("../events/Event.js").default} renderEvent Render event
|
|
524
|
+
* @private
|
|
525
|
+
*/
|
|
526
|
+
handlePrecompose_(e) {
|
|
527
|
+
const r = (
|
|
528
|
+
/** @type {import("../render/Event.js").default} */
|
|
529
|
+
e.frameState.layerStatesArray
|
|
530
|
+
), s = this.getLayerState(!1);
|
|
531
|
+
I(
|
|
532
|
+
!r.some(
|
|
533
|
+
(i) => i.layer === s.layer
|
|
534
|
+
),
|
|
535
|
+
"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."
|
|
536
|
+
), r.push(s);
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Set the layer source.
|
|
540
|
+
* @param {SourceType|null} source The layer source.
|
|
541
|
+
* @observable
|
|
542
|
+
* @api
|
|
543
|
+
*/
|
|
544
|
+
setSource(e) {
|
|
545
|
+
this.set(n.SOURCE, e);
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Get the renderer for this layer.
|
|
549
|
+
* @return {RendererType|null} The layer renderer.
|
|
550
|
+
*/
|
|
551
|
+
getRenderer() {
|
|
552
|
+
return this.renderer_ || (this.renderer_ = this.createRenderer()), this.renderer_;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* @return {boolean} The layer has a renderer.
|
|
556
|
+
*/
|
|
557
|
+
hasRenderer() {
|
|
558
|
+
return !!this.renderer_;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Create a renderer for this layer.
|
|
562
|
+
* @return {RendererType} A layer renderer.
|
|
563
|
+
* @protected
|
|
564
|
+
*/
|
|
565
|
+
createRenderer() {
|
|
566
|
+
return null;
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* This will clear the renderer so that a new one can be created next time it is needed
|
|
570
|
+
*/
|
|
571
|
+
clearRenderer() {
|
|
572
|
+
this.renderer_ && (this.renderer_.dispose(), delete this.renderer_);
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Clean up.
|
|
576
|
+
* @override
|
|
577
|
+
*/
|
|
578
|
+
disposeInternal() {
|
|
579
|
+
this.clearRenderer(), this.setSource(null), super.disposeInternal();
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
function X(t, e) {
|
|
583
|
+
if (!t.visible)
|
|
584
|
+
return !1;
|
|
585
|
+
const r = e.resolution;
|
|
586
|
+
if (r < t.minResolution || r >= t.maxResolution)
|
|
587
|
+
return !1;
|
|
588
|
+
const s = e.zoom;
|
|
589
|
+
return s > t.minZoom && s <= t.maxZoom;
|
|
590
|
+
}
|
|
591
|
+
const U = [NaN, NaN, NaN, 0];
|
|
592
|
+
let _;
|
|
593
|
+
function V() {
|
|
594
|
+
return _ || (_ = T(1, 1, void 0, {
|
|
595
|
+
willReadFrequently: !0,
|
|
596
|
+
desynchronized: !0
|
|
597
|
+
})), _;
|
|
598
|
+
}
|
|
599
|
+
const B = /^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i, k = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i, w = /^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i, z = /^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;
|
|
600
|
+
function f(t, e) {
|
|
601
|
+
return t.endsWith("%") ? Number(t.substring(0, t.length - 1)) / e : Number(t);
|
|
602
|
+
}
|
|
603
|
+
function l(t) {
|
|
604
|
+
throw new Error('failed to parse "' + t + '" as color');
|
|
605
|
+
}
|
|
606
|
+
function A(t) {
|
|
607
|
+
if (t.toLowerCase().startsWith("rgb")) {
|
|
608
|
+
const a = t.match(k) || t.match(B) || t.match(w);
|
|
609
|
+
if (a) {
|
|
610
|
+
const o = a[4], u = 100 / 255;
|
|
611
|
+
return [
|
|
612
|
+
h(f(a[1], u) + 0.5 | 0, 0, 255),
|
|
613
|
+
h(f(a[2], u) + 0.5 | 0, 0, 255),
|
|
614
|
+
h(f(a[3], u) + 0.5 | 0, 0, 255),
|
|
615
|
+
o !== void 0 ? h(f(o, 100), 0, 1) : 1
|
|
616
|
+
];
|
|
617
|
+
}
|
|
618
|
+
l(t);
|
|
619
|
+
}
|
|
620
|
+
if (t.startsWith("#")) {
|
|
621
|
+
if (z.test(t)) {
|
|
622
|
+
const a = t.substring(1), o = a.length <= 4 ? 1 : 2, u = [0, 0, 0, 255];
|
|
623
|
+
for (let c = 0, g = a.length; c < g; c += o) {
|
|
624
|
+
let y = parseInt(a.substring(c, c + o), 16);
|
|
625
|
+
o === 1 && (y += y << 4), u[c / o] = y;
|
|
626
|
+
}
|
|
627
|
+
return u[3] = u[3] / 255, u;
|
|
628
|
+
}
|
|
629
|
+
l(t);
|
|
630
|
+
}
|
|
631
|
+
const e = V();
|
|
632
|
+
e.fillStyle = "#abcdef";
|
|
633
|
+
let r = e.fillStyle;
|
|
634
|
+
e.fillStyle = t, e.fillStyle === r && (e.fillStyle = "#fedcba", r = e.fillStyle, e.fillStyle = t, e.fillStyle === r && l(t));
|
|
635
|
+
const s = e.fillStyle;
|
|
636
|
+
if (s.startsWith("#") || s.startsWith("rgba"))
|
|
637
|
+
return A(s);
|
|
638
|
+
e.clearRect(0, 0, 1, 1), e.fillRect(0, 0, 1, 1);
|
|
639
|
+
const i = Array.from(e.getImageData(0, 0, 1, 1).data);
|
|
640
|
+
return i[3] = P(i[3] / 255, 3), i;
|
|
641
|
+
}
|
|
642
|
+
function v(t) {
|
|
643
|
+
return typeof t == "string" ? t : H(t);
|
|
644
|
+
}
|
|
645
|
+
const F = 1024, d = {};
|
|
646
|
+
let R = 0;
|
|
647
|
+
function J(t) {
|
|
648
|
+
if (t.length === 4)
|
|
649
|
+
return t;
|
|
650
|
+
const e = t.slice();
|
|
651
|
+
return e[3] = 1, e;
|
|
652
|
+
}
|
|
653
|
+
function E(t) {
|
|
654
|
+
return t > 31308e-7 ? Math.pow(t, 1 / 2.4) * 269.025 - 14.025 : t * 3294.6;
|
|
655
|
+
}
|
|
656
|
+
function M(t) {
|
|
657
|
+
return t > 0.2068965 ? Math.pow(t, 3) : (t - 4 / 29) * (108 / 841);
|
|
658
|
+
}
|
|
659
|
+
function O(t) {
|
|
660
|
+
return t > 10.314724 ? Math.pow((t + 14.025) / 269.025, 2.4) : t / 3294.6;
|
|
661
|
+
}
|
|
662
|
+
function b(t) {
|
|
663
|
+
return t > 88564e-7 ? Math.pow(t, 1 / 3) : t / (108 / 841) + 4 / 29;
|
|
664
|
+
}
|
|
665
|
+
function Q(t) {
|
|
666
|
+
const e = O(t[0]), r = O(t[1]), s = O(t[2]), i = b(e * 0.222488403 + r * 0.716873169 + s * 0.06060791), a = 500 * (b(e * 0.452247074 + r * 0.399439023 + s * 0.148375274) - i), o = 200 * (i - b(e * 0.016863605 + r * 0.117638439 + s * 0.865350722)), u = Math.atan2(o, a) * (180 / Math.PI);
|
|
667
|
+
return [
|
|
668
|
+
116 * i - 16,
|
|
669
|
+
Math.sqrt(a * a + o * o),
|
|
670
|
+
u < 0 ? u + 360 : u,
|
|
671
|
+
t[3]
|
|
672
|
+
];
|
|
673
|
+
}
|
|
674
|
+
function ee(t) {
|
|
675
|
+
const e = (t[0] + 16) / 116, r = t[1], s = t[2] * Math.PI / 180, i = M(e), a = M(e + r / 500 * Math.cos(s)), o = M(e - r / 200 * Math.sin(s)), u = E(a * 3.021973625 - i * 1.617392459 - o * 0.404875592), c = E(a * -0.943766287 + i * 1.916279586 + o * 0.027607165), g = E(a * 0.069407491 - i * 0.22898585 + o * 1.159737864);
|
|
676
|
+
return [
|
|
677
|
+
h(u + 0.5 | 0, 0, 255),
|
|
678
|
+
h(c + 0.5 | 0, 0, 255),
|
|
679
|
+
h(g + 0.5 | 0, 0, 255),
|
|
680
|
+
t[3]
|
|
681
|
+
];
|
|
682
|
+
}
|
|
683
|
+
function j(t) {
|
|
684
|
+
if (t === "none")
|
|
685
|
+
return U;
|
|
686
|
+
if (d.hasOwnProperty(t))
|
|
687
|
+
return d[t];
|
|
688
|
+
if (R >= F) {
|
|
689
|
+
let r = 0;
|
|
690
|
+
for (const s in d)
|
|
691
|
+
(r++ & 3) === 0 && (delete d[s], --R);
|
|
692
|
+
}
|
|
693
|
+
const e = A(t);
|
|
694
|
+
e.length !== 4 && l(t);
|
|
695
|
+
for (const r of e)
|
|
696
|
+
isNaN(r) && l(t);
|
|
697
|
+
return d[t] = e, ++R, e;
|
|
698
|
+
}
|
|
699
|
+
function te(t) {
|
|
700
|
+
return Array.isArray(t) ? t : j(t);
|
|
701
|
+
}
|
|
702
|
+
function H(t) {
|
|
703
|
+
let e = t[0];
|
|
704
|
+
e != (e | 0) && (e = e + 0.5 | 0);
|
|
705
|
+
let r = t[1];
|
|
706
|
+
r != (r | 0) && (r = r + 0.5 | 0);
|
|
707
|
+
let s = t[2];
|
|
708
|
+
s != (s | 0) && (s = s + 0.5 | 0);
|
|
709
|
+
const i = t[3] === void 0 ? 1 : Math.round(t[3] * 1e3) / 1e3;
|
|
710
|
+
return "rgba(" + e + "," + r + "," + s + "," + i + ")";
|
|
711
|
+
}
|
|
712
|
+
class re extends Z {
|
|
713
|
+
/**
|
|
714
|
+
* @param {import("./EventType.js").default} type Type.
|
|
715
|
+
* @param {import("../transform.js").Transform} [inversePixelTransform] Transform for
|
|
716
|
+
* CSS pixels to rendered pixels.
|
|
717
|
+
* @param {import("../Map.js").FrameState} [frameState] Frame state.
|
|
718
|
+
* @param {?(CanvasRenderingContext2D|WebGLRenderingContext)} [context] Context.
|
|
719
|
+
*/
|
|
720
|
+
constructor(e, r, s, i) {
|
|
721
|
+
super(e), this.inversePixelTransform = r, this.frameState = s, this.context = i;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
export {
|
|
725
|
+
D as B,
|
|
726
|
+
K as E,
|
|
727
|
+
G as L,
|
|
728
|
+
U as N,
|
|
729
|
+
re as R,
|
|
730
|
+
te as a,
|
|
731
|
+
v as b,
|
|
732
|
+
j as f,
|
|
733
|
+
X as i,
|
|
734
|
+
ee as l,
|
|
735
|
+
Q as r,
|
|
736
|
+
H as t,
|
|
737
|
+
J as w
|
|
738
|
+
};
|