@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,1569 @@
|
|
|
1
|
+
const Hn = {
|
|
2
|
+
/**
|
|
3
|
+
* Triggered when a property is changed.
|
|
4
|
+
* @event module:ol/Object.ObjectEvent#propertychange
|
|
5
|
+
* @api
|
|
6
|
+
*/
|
|
7
|
+
PROPERTYCHANGE: "propertychange"
|
|
8
|
+
}, Kn = {
|
|
9
|
+
/**
|
|
10
|
+
* Generic change event. Triggered when the revision counter is increased.
|
|
11
|
+
* @event module:ol/events/Event~BaseEvent#change
|
|
12
|
+
* @api
|
|
13
|
+
*/
|
|
14
|
+
CHANGE: "change",
|
|
15
|
+
/**
|
|
16
|
+
* Generic error event. Triggered when an error occurs.
|
|
17
|
+
* @event module:ol/events/Event~BaseEvent#error
|
|
18
|
+
* @api
|
|
19
|
+
*/
|
|
20
|
+
ERROR: "error",
|
|
21
|
+
CONTEXTMENU: "contextmenu",
|
|
22
|
+
CLICK: "click",
|
|
23
|
+
DBLCLICK: "dblclick",
|
|
24
|
+
KEYDOWN: "keydown",
|
|
25
|
+
KEYPRESS: "keypress",
|
|
26
|
+
LOAD: "load",
|
|
27
|
+
TOUCHMOVE: "touchmove",
|
|
28
|
+
WHEEL: "wheel"
|
|
29
|
+
};
|
|
30
|
+
class Vn {
|
|
31
|
+
constructor() {
|
|
32
|
+
this.disposed = !1;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Clean up.
|
|
36
|
+
*/
|
|
37
|
+
dispose() {
|
|
38
|
+
this.disposed || (this.disposed = !0, this.disposeInternal());
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Extension point for disposable objects.
|
|
42
|
+
* @protected
|
|
43
|
+
*/
|
|
44
|
+
disposeInternal() {
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function Vt(n, t, s) {
|
|
48
|
+
let e, r;
|
|
49
|
+
s = s || Sn;
|
|
50
|
+
let i = 0, o = n.length, a = !1;
|
|
51
|
+
for (; i < o; )
|
|
52
|
+
e = i + (o - i >> 1), r = +s(n[e], t), r < 0 ? i = e + 1 : (o = e, a = !r);
|
|
53
|
+
return a ? i : ~i;
|
|
54
|
+
}
|
|
55
|
+
function Sn(n, t) {
|
|
56
|
+
return n > t ? 1 : n < t ? -1 : 0;
|
|
57
|
+
}
|
|
58
|
+
function jt(n, t) {
|
|
59
|
+
return n < t ? 1 : n > t ? -1 : 0;
|
|
60
|
+
}
|
|
61
|
+
function zt(n, t, s) {
|
|
62
|
+
if (n[0] <= t)
|
|
63
|
+
return 0;
|
|
64
|
+
const e = n.length;
|
|
65
|
+
if (t <= n[e - 1])
|
|
66
|
+
return e - 1;
|
|
67
|
+
if (typeof s == "function") {
|
|
68
|
+
for (let r = 1; r < e; ++r) {
|
|
69
|
+
const i = n[r];
|
|
70
|
+
if (i === t)
|
|
71
|
+
return r;
|
|
72
|
+
if (i < t)
|
|
73
|
+
return s(t, n[r - 1], i) > 0 ? r - 1 : r;
|
|
74
|
+
}
|
|
75
|
+
return e - 1;
|
|
76
|
+
}
|
|
77
|
+
if (s > 0) {
|
|
78
|
+
for (let r = 1; r < e; ++r)
|
|
79
|
+
if (n[r] < t)
|
|
80
|
+
return r - 1;
|
|
81
|
+
return e - 1;
|
|
82
|
+
}
|
|
83
|
+
if (s < 0) {
|
|
84
|
+
for (let r = 1; r < e; ++r)
|
|
85
|
+
if (n[r] <= t)
|
|
86
|
+
return r;
|
|
87
|
+
return e - 1;
|
|
88
|
+
}
|
|
89
|
+
for (let r = 1; r < e; ++r) {
|
|
90
|
+
if (n[r] == t)
|
|
91
|
+
return r;
|
|
92
|
+
if (n[r] < t)
|
|
93
|
+
return n[r - 1] - t < t - n[r] ? r - 1 : r;
|
|
94
|
+
}
|
|
95
|
+
return e - 1;
|
|
96
|
+
}
|
|
97
|
+
function kt(n, t, s) {
|
|
98
|
+
for (; t < s; ) {
|
|
99
|
+
const e = n[t];
|
|
100
|
+
n[t] = n[s], n[s] = e, ++t, --s;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function Jt(n, t) {
|
|
104
|
+
const s = Array.isArray(t) ? t : [t], e = s.length;
|
|
105
|
+
for (let r = 0; r < e; r++)
|
|
106
|
+
n[n.length] = s[r];
|
|
107
|
+
}
|
|
108
|
+
function jn(n, t) {
|
|
109
|
+
const s = n.length;
|
|
110
|
+
if (s !== t.length)
|
|
111
|
+
return !1;
|
|
112
|
+
for (let e = 0; e < s; e++)
|
|
113
|
+
if (n[e] !== t[e])
|
|
114
|
+
return !1;
|
|
115
|
+
return !0;
|
|
116
|
+
}
|
|
117
|
+
function Qt(n, t, s) {
|
|
118
|
+
const e = t || Sn;
|
|
119
|
+
return n.every(function(r, i) {
|
|
120
|
+
if (i === 0)
|
|
121
|
+
return !0;
|
|
122
|
+
const o = e(n[i - 1], r);
|
|
123
|
+
return !(o > 0 || o === 0);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function Zt() {
|
|
127
|
+
return !0;
|
|
128
|
+
}
|
|
129
|
+
function xt() {
|
|
130
|
+
return !1;
|
|
131
|
+
}
|
|
132
|
+
function ln() {
|
|
133
|
+
}
|
|
134
|
+
function ns(n) {
|
|
135
|
+
let t, s, e;
|
|
136
|
+
return function() {
|
|
137
|
+
const r = Array.prototype.slice.call(arguments);
|
|
138
|
+
return (!s || this !== e || !jn(r, s)) && (e = this, s = r, t = n.apply(this, arguments)), t;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function ts(n) {
|
|
142
|
+
function t() {
|
|
143
|
+
let s;
|
|
144
|
+
try {
|
|
145
|
+
s = n();
|
|
146
|
+
} catch (e) {
|
|
147
|
+
return Promise.reject(e);
|
|
148
|
+
}
|
|
149
|
+
return s instanceof Promise ? s : Promise.resolve(s);
|
|
150
|
+
}
|
|
151
|
+
return t();
|
|
152
|
+
}
|
|
153
|
+
function Rn(n) {
|
|
154
|
+
for (const t in n)
|
|
155
|
+
delete n[t];
|
|
156
|
+
}
|
|
157
|
+
function zn(n) {
|
|
158
|
+
let t;
|
|
159
|
+
for (t in n)
|
|
160
|
+
return !1;
|
|
161
|
+
return !t;
|
|
162
|
+
}
|
|
163
|
+
class Cn {
|
|
164
|
+
/**
|
|
165
|
+
* @param {string} type Type.
|
|
166
|
+
*/
|
|
167
|
+
constructor(t) {
|
|
168
|
+
this.propagationStopped, this.defaultPrevented, this.type = t, this.target = null;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Prevent default. This means that no emulated `click`, `singleclick` or `doubleclick` events
|
|
172
|
+
* will be fired.
|
|
173
|
+
* @api
|
|
174
|
+
*/
|
|
175
|
+
preventDefault() {
|
|
176
|
+
this.defaultPrevented = !0;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Stop event propagation.
|
|
180
|
+
* @api
|
|
181
|
+
*/
|
|
182
|
+
stopPropagation() {
|
|
183
|
+
this.propagationStopped = !0;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
class kn extends Vn {
|
|
187
|
+
/**
|
|
188
|
+
* @param {*} [target] Default event target for dispatched events.
|
|
189
|
+
*/
|
|
190
|
+
constructor(t) {
|
|
191
|
+
super(), this.eventTarget_ = t, this.pendingRemovals_ = null, this.dispatching_ = null, this.listeners_ = null;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* @param {string} type Type.
|
|
195
|
+
* @param {import("../events.js").Listener} listener Listener.
|
|
196
|
+
*/
|
|
197
|
+
addEventListener(t, s) {
|
|
198
|
+
if (!t || !s)
|
|
199
|
+
return;
|
|
200
|
+
const e = this.listeners_ || (this.listeners_ = {}), r = e[t] || (e[t] = []);
|
|
201
|
+
r.includes(s) || r.push(s);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Dispatches an event and calls all listeners listening for events
|
|
205
|
+
* of this type. The event parameter can either be a string or an
|
|
206
|
+
* Object with a `type` property.
|
|
207
|
+
*
|
|
208
|
+
* @param {import("./Event.js").default|string} event Event object.
|
|
209
|
+
* @return {boolean|undefined} `false` if anyone called preventDefault on the
|
|
210
|
+
* event object or if any of the listeners returned false.
|
|
211
|
+
* @api
|
|
212
|
+
*/
|
|
213
|
+
dispatchEvent(t) {
|
|
214
|
+
const s = typeof t == "string", e = s ? t : t.type, r = this.listeners_ && this.listeners_[e];
|
|
215
|
+
if (!r)
|
|
216
|
+
return;
|
|
217
|
+
const i = s ? new Cn(t) : (
|
|
218
|
+
/** @type {Event} */
|
|
219
|
+
t
|
|
220
|
+
);
|
|
221
|
+
i.target || (i.target = this.eventTarget_ || this);
|
|
222
|
+
const o = this.dispatching_ || (this.dispatching_ = {}), a = this.pendingRemovals_ || (this.pendingRemovals_ = {});
|
|
223
|
+
e in o || (o[e] = 0, a[e] = 0), ++o[e];
|
|
224
|
+
let c;
|
|
225
|
+
for (let l = 0, f = r.length; l < f; ++l)
|
|
226
|
+
if ("handleEvent" in r[l] ? c = /** @type {import("../events.js").ListenerObject} */
|
|
227
|
+
r[l].handleEvent(i) : c = /** @type {import("../events.js").ListenerFunction} */
|
|
228
|
+
r[l].call(this, i), c === !1 || i.propagationStopped) {
|
|
229
|
+
c = !1;
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
if (--o[e] === 0) {
|
|
233
|
+
let l = a[e];
|
|
234
|
+
for (delete a[e]; l--; )
|
|
235
|
+
this.removeEventListener(e, ln);
|
|
236
|
+
delete o[e];
|
|
237
|
+
}
|
|
238
|
+
return c;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Clean up.
|
|
242
|
+
* @override
|
|
243
|
+
*/
|
|
244
|
+
disposeInternal() {
|
|
245
|
+
this.listeners_ && Rn(this.listeners_);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Get the listeners for a specified event type. Listeners are returned in the
|
|
249
|
+
* order that they will be called in.
|
|
250
|
+
*
|
|
251
|
+
* @param {string} type Type.
|
|
252
|
+
* @return {Array<import("../events.js").Listener>|undefined} Listeners.
|
|
253
|
+
*/
|
|
254
|
+
getListeners(t) {
|
|
255
|
+
return this.listeners_ && this.listeners_[t] || void 0;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* @param {string} [type] Type. If not provided,
|
|
259
|
+
* `true` will be returned if this event target has any listeners.
|
|
260
|
+
* @return {boolean} Has listeners.
|
|
261
|
+
*/
|
|
262
|
+
hasListener(t) {
|
|
263
|
+
return this.listeners_ ? t ? t in this.listeners_ : Object.keys(this.listeners_).length > 0 : !1;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* @param {string} type Type.
|
|
267
|
+
* @param {import("../events.js").Listener} listener Listener.
|
|
268
|
+
*/
|
|
269
|
+
removeEventListener(t, s) {
|
|
270
|
+
if (!this.listeners_)
|
|
271
|
+
return;
|
|
272
|
+
const e = this.listeners_[t];
|
|
273
|
+
if (!e)
|
|
274
|
+
return;
|
|
275
|
+
const r = e.indexOf(s);
|
|
276
|
+
r !== -1 && (this.pendingRemovals_ && t in this.pendingRemovals_ ? (e[r] = ln, ++this.pendingRemovals_[t]) : (e.splice(r, 1), e.length === 0 && delete this.listeners_[t]));
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function j(n, t, s, e, r) {
|
|
280
|
+
if (r) {
|
|
281
|
+
const o = s;
|
|
282
|
+
s = function(a) {
|
|
283
|
+
return n.removeEventListener(t, s), o.call(e ?? this, a);
|
|
284
|
+
};
|
|
285
|
+
} else e && e !== n && (s = s.bind(e));
|
|
286
|
+
const i = {
|
|
287
|
+
target: n,
|
|
288
|
+
type: t,
|
|
289
|
+
listener: s
|
|
290
|
+
};
|
|
291
|
+
return n.addEventListener(t, s), i;
|
|
292
|
+
}
|
|
293
|
+
function fn(n, t, s, e) {
|
|
294
|
+
return j(n, t, s, e, !0);
|
|
295
|
+
}
|
|
296
|
+
function un(n) {
|
|
297
|
+
n && n.target && (n.target.removeEventListener(n.type, n.listener), Rn(n));
|
|
298
|
+
}
|
|
299
|
+
class $ extends kn {
|
|
300
|
+
constructor() {
|
|
301
|
+
super(), this.on = /** @type {ObservableOnSignature<import("./events").EventsKey>} */
|
|
302
|
+
this.onInternal, this.once = /** @type {ObservableOnSignature<import("./events").EventsKey>} */
|
|
303
|
+
this.onceInternal, this.un = /** @type {ObservableOnSignature<void>} */
|
|
304
|
+
this.unInternal, this.revision_ = 0;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Increases the revision counter and dispatches a 'change' event.
|
|
308
|
+
* @api
|
|
309
|
+
*/
|
|
310
|
+
changed() {
|
|
311
|
+
++this.revision_, this.dispatchEvent(Kn.CHANGE);
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Get the version number for this object. Each time the object is modified,
|
|
315
|
+
* its version number will be incremented.
|
|
316
|
+
* @return {number} Revision.
|
|
317
|
+
* @api
|
|
318
|
+
*/
|
|
319
|
+
getRevision() {
|
|
320
|
+
return this.revision_;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* @param {string|Array<string>} type Type.
|
|
324
|
+
* @param {function((Event|import("./events/Event").default)): ?} listener Listener.
|
|
325
|
+
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Event key.
|
|
326
|
+
* @protected
|
|
327
|
+
*/
|
|
328
|
+
onInternal(t, s) {
|
|
329
|
+
if (Array.isArray(t)) {
|
|
330
|
+
const e = t.length, r = new Array(e);
|
|
331
|
+
for (let i = 0; i < e; ++i)
|
|
332
|
+
r[i] = j(this, t[i], s);
|
|
333
|
+
return r;
|
|
334
|
+
}
|
|
335
|
+
return j(
|
|
336
|
+
this,
|
|
337
|
+
/** @type {string} */
|
|
338
|
+
t,
|
|
339
|
+
s
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* @param {string|Array<string>} type Type.
|
|
344
|
+
* @param {function((Event|import("./events/Event").default)): ?} listener Listener.
|
|
345
|
+
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Event key.
|
|
346
|
+
* @protected
|
|
347
|
+
*/
|
|
348
|
+
onceInternal(t, s) {
|
|
349
|
+
let e;
|
|
350
|
+
if (Array.isArray(t)) {
|
|
351
|
+
const r = t.length;
|
|
352
|
+
e = new Array(r);
|
|
353
|
+
for (let i = 0; i < r; ++i)
|
|
354
|
+
e[i] = fn(this, t[i], s);
|
|
355
|
+
} else
|
|
356
|
+
e = fn(
|
|
357
|
+
this,
|
|
358
|
+
/** @type {string} */
|
|
359
|
+
t,
|
|
360
|
+
s
|
|
361
|
+
);
|
|
362
|
+
return s.ol_key = e, e;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Unlisten for a certain type of event.
|
|
366
|
+
* @param {string|Array<string>} type Type.
|
|
367
|
+
* @param {function((Event|import("./events/Event").default)): ?} listener Listener.
|
|
368
|
+
* @protected
|
|
369
|
+
*/
|
|
370
|
+
unInternal(t, s) {
|
|
371
|
+
const e = (
|
|
372
|
+
/** @type {Object} */
|
|
373
|
+
s.ol_key
|
|
374
|
+
);
|
|
375
|
+
if (e)
|
|
376
|
+
Jn(e);
|
|
377
|
+
else if (Array.isArray(t))
|
|
378
|
+
for (let r = 0, i = t.length; r < i; ++r)
|
|
379
|
+
this.removeEventListener(t[r], s);
|
|
380
|
+
else
|
|
381
|
+
this.removeEventListener(t, s);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
$.prototype.on;
|
|
385
|
+
$.prototype.once;
|
|
386
|
+
$.prototype.un;
|
|
387
|
+
function Jn(n) {
|
|
388
|
+
if (Array.isArray(n))
|
|
389
|
+
for (let t = 0, s = n.length; t < s; ++t)
|
|
390
|
+
un(n[t]);
|
|
391
|
+
else
|
|
392
|
+
un(
|
|
393
|
+
/** @type {import("./events.js").EventsKey} */
|
|
394
|
+
n
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
function ss() {
|
|
398
|
+
throw new Error("Unimplemented abstract method.");
|
|
399
|
+
}
|
|
400
|
+
let Qn = 0;
|
|
401
|
+
function Zn(n) {
|
|
402
|
+
return n.ol_uid || (n.ol_uid = String(++Qn));
|
|
403
|
+
}
|
|
404
|
+
class hn extends Cn {
|
|
405
|
+
/**
|
|
406
|
+
* @param {string} type The event type.
|
|
407
|
+
* @param {string} key The property name.
|
|
408
|
+
* @param {*} oldValue The old value for `key`.
|
|
409
|
+
*/
|
|
410
|
+
constructor(t, s, e) {
|
|
411
|
+
super(t), this.key = s, this.oldValue = e;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
class es extends $ {
|
|
415
|
+
/**
|
|
416
|
+
* @param {Object<string, *>} [values] An object with key-value pairs.
|
|
417
|
+
*/
|
|
418
|
+
constructor(t) {
|
|
419
|
+
super(), this.on, this.once, this.un, Zn(this), this.values_ = null, t !== void 0 && this.setProperties(t);
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Gets a value.
|
|
423
|
+
* @param {string} key Key name.
|
|
424
|
+
* @return {*} Value.
|
|
425
|
+
* @api
|
|
426
|
+
*/
|
|
427
|
+
get(t) {
|
|
428
|
+
let s;
|
|
429
|
+
return this.values_ && this.values_.hasOwnProperty(t) && (s = this.values_[t]), s;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Get a list of object property names.
|
|
433
|
+
* @return {Array<string>} List of property names.
|
|
434
|
+
* @api
|
|
435
|
+
*/
|
|
436
|
+
getKeys() {
|
|
437
|
+
return this.values_ && Object.keys(this.values_) || [];
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Get an object of all property names and values.
|
|
441
|
+
* @return {Object<string, *>} Object.
|
|
442
|
+
* @api
|
|
443
|
+
*/
|
|
444
|
+
getProperties() {
|
|
445
|
+
return this.values_ && Object.assign({}, this.values_) || {};
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Get an object of all property names and values.
|
|
449
|
+
* @return {Object<string, *>?} Object.
|
|
450
|
+
*/
|
|
451
|
+
getPropertiesInternal() {
|
|
452
|
+
return this.values_;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* @return {boolean} The object has properties.
|
|
456
|
+
*/
|
|
457
|
+
hasProperties() {
|
|
458
|
+
return !!this.values_;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* @param {string} key Key name.
|
|
462
|
+
* @param {*} oldValue Old value.
|
|
463
|
+
*/
|
|
464
|
+
notify(t, s) {
|
|
465
|
+
let e;
|
|
466
|
+
e = `change:${t}`, this.hasListener(e) && this.dispatchEvent(new hn(e, t, s)), e = Hn.PROPERTYCHANGE, this.hasListener(e) && this.dispatchEvent(new hn(e, t, s));
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* @param {string} key Key name.
|
|
470
|
+
* @param {import("./events.js").Listener} listener Listener.
|
|
471
|
+
*/
|
|
472
|
+
addChangeListener(t, s) {
|
|
473
|
+
this.addEventListener(`change:${t}`, s);
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* @param {string} key Key name.
|
|
477
|
+
* @param {import("./events.js").Listener} listener Listener.
|
|
478
|
+
*/
|
|
479
|
+
removeChangeListener(t, s) {
|
|
480
|
+
this.removeEventListener(`change:${t}`, s);
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Sets a value.
|
|
484
|
+
* @param {string} key Key name.
|
|
485
|
+
* @param {*} value Value.
|
|
486
|
+
* @param {boolean} [silent] Update without triggering an event.
|
|
487
|
+
* @api
|
|
488
|
+
*/
|
|
489
|
+
set(t, s, e) {
|
|
490
|
+
const r = this.values_ || (this.values_ = {});
|
|
491
|
+
if (e)
|
|
492
|
+
r[t] = s;
|
|
493
|
+
else {
|
|
494
|
+
const i = r[t];
|
|
495
|
+
r[t] = s, i !== s && this.notify(t, i);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Sets a collection of key-value pairs. Note that this changes any existing
|
|
500
|
+
* properties and adds new ones (it does not remove any existing properties).
|
|
501
|
+
* @param {Object<string, *>} values Values.
|
|
502
|
+
* @param {boolean} [silent] Update without triggering an event.
|
|
503
|
+
* @api
|
|
504
|
+
*/
|
|
505
|
+
setProperties(t, s) {
|
|
506
|
+
for (const e in t)
|
|
507
|
+
this.set(e, t[e], s);
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Apply any properties from another object without triggering events.
|
|
511
|
+
* @param {BaseObject} source The source object.
|
|
512
|
+
* @protected
|
|
513
|
+
*/
|
|
514
|
+
applyProperties(t) {
|
|
515
|
+
t.values_ && Object.assign(this.values_ || (this.values_ = {}), t.values_);
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Unsets a property.
|
|
519
|
+
* @param {string} key Key name.
|
|
520
|
+
* @param {boolean} [silent] Unset without triggering an event.
|
|
521
|
+
* @api
|
|
522
|
+
*/
|
|
523
|
+
unset(t, s) {
|
|
524
|
+
if (this.values_ && t in this.values_) {
|
|
525
|
+
const e = this.values_[t];
|
|
526
|
+
delete this.values_[t], zn(this.values_) && (this.values_ = null), s || this.notify(t, e);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
function rs(n, t, s) {
|
|
531
|
+
return Math.min(Math.max(n, t), s);
|
|
532
|
+
}
|
|
533
|
+
function is(n, t, s, e, r, i) {
|
|
534
|
+
const o = r - s, a = i - e;
|
|
535
|
+
if (o !== 0 || a !== 0) {
|
|
536
|
+
const c = ((n - s) * o + (t - e) * a) / (o * o + a * a);
|
|
537
|
+
c > 1 ? (s = r, e = i) : c > 0 && (s += o * c, e += a * c);
|
|
538
|
+
}
|
|
539
|
+
return xn(n, t, s, e);
|
|
540
|
+
}
|
|
541
|
+
function xn(n, t, s, e) {
|
|
542
|
+
const r = s - n, i = e - t;
|
|
543
|
+
return r * r + i * i;
|
|
544
|
+
}
|
|
545
|
+
function os(n) {
|
|
546
|
+
const t = n.length;
|
|
547
|
+
for (let e = 0; e < t; e++) {
|
|
548
|
+
let r = e, i = Math.abs(n[e][e]);
|
|
549
|
+
for (let a = e + 1; a < t; a++) {
|
|
550
|
+
const c = Math.abs(n[a][e]);
|
|
551
|
+
c > i && (i = c, r = a);
|
|
552
|
+
}
|
|
553
|
+
if (i === 0)
|
|
554
|
+
return null;
|
|
555
|
+
const o = n[r];
|
|
556
|
+
n[r] = n[e], n[e] = o;
|
|
557
|
+
for (let a = e + 1; a < t; a++) {
|
|
558
|
+
const c = -n[a][e] / n[e][e];
|
|
559
|
+
for (let l = e; l < t + 1; l++)
|
|
560
|
+
e == l ? n[a][l] = 0 : n[a][l] += c * n[e][l];
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
const s = new Array(t);
|
|
564
|
+
for (let e = t - 1; e >= 0; e--) {
|
|
565
|
+
s[e] = n[e][t] / n[e][e];
|
|
566
|
+
for (let r = e - 1; r >= 0; r--)
|
|
567
|
+
n[r][t] -= n[r][e] * s[e];
|
|
568
|
+
}
|
|
569
|
+
return s;
|
|
570
|
+
}
|
|
571
|
+
function gn(n) {
|
|
572
|
+
return n * 180 / Math.PI;
|
|
573
|
+
}
|
|
574
|
+
function M(n) {
|
|
575
|
+
return n * Math.PI / 180;
|
|
576
|
+
}
|
|
577
|
+
function as(n, t) {
|
|
578
|
+
const s = n % t;
|
|
579
|
+
return s * t < 0 ? s + t : s;
|
|
580
|
+
}
|
|
581
|
+
function cs(n, t, s) {
|
|
582
|
+
return n + s * (t - n);
|
|
583
|
+
}
|
|
584
|
+
function x(n, t) {
|
|
585
|
+
const s = Math.pow(10, t);
|
|
586
|
+
return Math.round(n * s) / s;
|
|
587
|
+
}
|
|
588
|
+
function ls(n, t) {
|
|
589
|
+
return Math.round(x(n, t));
|
|
590
|
+
}
|
|
591
|
+
function fs(n, t) {
|
|
592
|
+
return Math.floor(x(n, t));
|
|
593
|
+
}
|
|
594
|
+
function us(n, t) {
|
|
595
|
+
return Math.ceil(x(n, t));
|
|
596
|
+
}
|
|
597
|
+
function z(n, t, s) {
|
|
598
|
+
if (n >= t && n < s)
|
|
599
|
+
return n;
|
|
600
|
+
const e = s - t;
|
|
601
|
+
return ((n - t) % e + e) % e + t;
|
|
602
|
+
}
|
|
603
|
+
const E = {
|
|
604
|
+
UNKNOWN: 0,
|
|
605
|
+
INTERSECTING: 1,
|
|
606
|
+
ABOVE: 2,
|
|
607
|
+
RIGHT: 4,
|
|
608
|
+
BELOW: 8,
|
|
609
|
+
LEFT: 16
|
|
610
|
+
};
|
|
611
|
+
function hs(n) {
|
|
612
|
+
const t = In();
|
|
613
|
+
for (let s = 0, e = n.length; s < e; ++s)
|
|
614
|
+
st(t, n[s]);
|
|
615
|
+
return t;
|
|
616
|
+
}
|
|
617
|
+
function nt(n, t, s) {
|
|
618
|
+
const e = Math.min.apply(null, n), r = Math.min.apply(null, t), i = Math.max.apply(null, n), o = Math.max.apply(null, t);
|
|
619
|
+
return q(e, r, i, o, s);
|
|
620
|
+
}
|
|
621
|
+
function gs(n, t, s) {
|
|
622
|
+
return s ? (s[0] = n[0] - t, s[1] = n[1] - t, s[2] = n[2] + t, s[3] = n[3] + t, s) : [
|
|
623
|
+
n[0] - t,
|
|
624
|
+
n[1] - t,
|
|
625
|
+
n[2] + t,
|
|
626
|
+
n[3] + t
|
|
627
|
+
];
|
|
628
|
+
}
|
|
629
|
+
function ds(n, t) {
|
|
630
|
+
return t ? (t[0] = n[0], t[1] = n[1], t[2] = n[2], t[3] = n[3], t) : n.slice();
|
|
631
|
+
}
|
|
632
|
+
function Es(n, t, s) {
|
|
633
|
+
let e, r;
|
|
634
|
+
return t < n[0] ? e = n[0] - t : n[2] < t ? e = t - n[2] : e = 0, s < n[1] ? r = n[1] - s : n[3] < s ? r = s - n[3] : r = 0, e * e + r * r;
|
|
635
|
+
}
|
|
636
|
+
function Ps(n, t) {
|
|
637
|
+
return tt(n, t[0], t[1]);
|
|
638
|
+
}
|
|
639
|
+
function _s(n, t) {
|
|
640
|
+
return n[0] <= t[0] && t[2] <= n[2] && n[1] <= t[1] && t[3] <= n[3];
|
|
641
|
+
}
|
|
642
|
+
function tt(n, t, s) {
|
|
643
|
+
return n[0] <= t && t <= n[2] && n[1] <= s && s <= n[3];
|
|
644
|
+
}
|
|
645
|
+
function dn(n, t) {
|
|
646
|
+
const s = n[0], e = n[1], r = n[2], i = n[3], o = t[0], a = t[1];
|
|
647
|
+
let c = E.UNKNOWN;
|
|
648
|
+
return o < s ? c = c | E.LEFT : o > r && (c = c | E.RIGHT), a < e ? c = c | E.BELOW : a > i && (c = c | E.ABOVE), c === E.UNKNOWN && (c = E.INTERSECTING), c;
|
|
649
|
+
}
|
|
650
|
+
function In() {
|
|
651
|
+
return [1 / 0, 1 / 0, -1 / 0, -1 / 0];
|
|
652
|
+
}
|
|
653
|
+
function q(n, t, s, e, r) {
|
|
654
|
+
return r ? (r[0] = n, r[1] = t, r[2] = s, r[3] = e, r) : [n, t, s, e];
|
|
655
|
+
}
|
|
656
|
+
function nn(n) {
|
|
657
|
+
return q(1 / 0, 1 / 0, -1 / 0, -1 / 0, n);
|
|
658
|
+
}
|
|
659
|
+
function ms(n, t) {
|
|
660
|
+
const s = n[0], e = n[1];
|
|
661
|
+
return q(s, e, s, e, t);
|
|
662
|
+
}
|
|
663
|
+
function Ms(n, t, s, e, r) {
|
|
664
|
+
const i = nn(r);
|
|
665
|
+
return et(i, n, t, s, e);
|
|
666
|
+
}
|
|
667
|
+
function ws(n, t) {
|
|
668
|
+
return n[0] == t[0] && n[2] == t[2] && n[1] == t[1] && n[3] == t[3];
|
|
669
|
+
}
|
|
670
|
+
function Ts(n, t) {
|
|
671
|
+
return t[0] < n[0] && (n[0] = t[0]), t[2] > n[2] && (n[2] = t[2]), t[1] < n[1] && (n[1] = t[1]), t[3] > n[3] && (n[3] = t[3]), n;
|
|
672
|
+
}
|
|
673
|
+
function st(n, t) {
|
|
674
|
+
t[0] < n[0] && (n[0] = t[0]), t[0] > n[2] && (n[2] = t[0]), t[1] < n[1] && (n[1] = t[1]), t[1] > n[3] && (n[3] = t[1]);
|
|
675
|
+
}
|
|
676
|
+
function et(n, t, s, e, r) {
|
|
677
|
+
for (; s < e; s += r)
|
|
678
|
+
rt(n, t[s], t[s + 1]);
|
|
679
|
+
return n;
|
|
680
|
+
}
|
|
681
|
+
function rt(n, t, s) {
|
|
682
|
+
n[0] = Math.min(n[0], t), n[1] = Math.min(n[1], s), n[2] = Math.max(n[2], t), n[3] = Math.max(n[3], s);
|
|
683
|
+
}
|
|
684
|
+
function ps(n, t) {
|
|
685
|
+
let s;
|
|
686
|
+
return s = t(On(n)), s || (s = t(Gn(n)), s) || (s = t(An(n)), s) || (s = t(Ln(n)), s) ? s : !1;
|
|
687
|
+
}
|
|
688
|
+
function ys(n) {
|
|
689
|
+
let t = 0;
|
|
690
|
+
return Un(n) || (t = O(n) * at(n)), t;
|
|
691
|
+
}
|
|
692
|
+
function On(n) {
|
|
693
|
+
return [n[0], n[1]];
|
|
694
|
+
}
|
|
695
|
+
function Gn(n) {
|
|
696
|
+
return [n[2], n[1]];
|
|
697
|
+
}
|
|
698
|
+
function it(n) {
|
|
699
|
+
return [(n[0] + n[2]) / 2, (n[1] + n[3]) / 2];
|
|
700
|
+
}
|
|
701
|
+
function vs(n, t) {
|
|
702
|
+
let s;
|
|
703
|
+
if (t === "bottom-left")
|
|
704
|
+
s = On(n);
|
|
705
|
+
else if (t === "bottom-right")
|
|
706
|
+
s = Gn(n);
|
|
707
|
+
else if (t === "top-left")
|
|
708
|
+
s = Ln(n);
|
|
709
|
+
else if (t === "top-right")
|
|
710
|
+
s = An(n);
|
|
711
|
+
else
|
|
712
|
+
throw new Error("Invalid corner");
|
|
713
|
+
return s;
|
|
714
|
+
}
|
|
715
|
+
function Ss(n, t, s, e, r) {
|
|
716
|
+
const [i, o, a, c, l, f, h, u] = ot(
|
|
717
|
+
n,
|
|
718
|
+
t,
|
|
719
|
+
s,
|
|
720
|
+
e
|
|
721
|
+
);
|
|
722
|
+
return q(
|
|
723
|
+
Math.min(i, a, l, h),
|
|
724
|
+
Math.min(o, c, f, u),
|
|
725
|
+
Math.max(i, a, l, h),
|
|
726
|
+
Math.max(o, c, f, u),
|
|
727
|
+
r
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
function ot(n, t, s, e) {
|
|
731
|
+
const r = t * e[0] / 2, i = t * e[1] / 2, o = Math.cos(s), a = Math.sin(s), c = r * o, l = r * a, f = i * o, h = i * a, u = n[0], g = n[1];
|
|
732
|
+
return [
|
|
733
|
+
u - c + h,
|
|
734
|
+
g - l - f,
|
|
735
|
+
u - c - h,
|
|
736
|
+
g - l + f,
|
|
737
|
+
u + c - h,
|
|
738
|
+
g + l + f,
|
|
739
|
+
u + c + h,
|
|
740
|
+
g + l - f,
|
|
741
|
+
u - c + h,
|
|
742
|
+
g - l - f
|
|
743
|
+
];
|
|
744
|
+
}
|
|
745
|
+
function at(n) {
|
|
746
|
+
return n[3] - n[1];
|
|
747
|
+
}
|
|
748
|
+
function Rs(n, t, s) {
|
|
749
|
+
const e = s || In();
|
|
750
|
+
return ct(n, t) ? (n[0] > t[0] ? e[0] = n[0] : e[0] = t[0], n[1] > t[1] ? e[1] = n[1] : e[1] = t[1], n[2] < t[2] ? e[2] = n[2] : e[2] = t[2], n[3] < t[3] ? e[3] = n[3] : e[3] = t[3]) : nn(e), e;
|
|
751
|
+
}
|
|
752
|
+
function Ln(n) {
|
|
753
|
+
return [n[0], n[3]];
|
|
754
|
+
}
|
|
755
|
+
function An(n) {
|
|
756
|
+
return [n[2], n[3]];
|
|
757
|
+
}
|
|
758
|
+
function O(n) {
|
|
759
|
+
return n[2] - n[0];
|
|
760
|
+
}
|
|
761
|
+
function ct(n, t) {
|
|
762
|
+
return n[0] <= t[2] && n[2] >= t[0] && n[1] <= t[3] && n[3] >= t[1];
|
|
763
|
+
}
|
|
764
|
+
function Un(n) {
|
|
765
|
+
return n[2] < n[0] || n[3] < n[1];
|
|
766
|
+
}
|
|
767
|
+
function Cs(n, t) {
|
|
768
|
+
return t ? (t[0] = n[0], t[1] = n[1], t[2] = n[2], t[3] = n[3], t) : n;
|
|
769
|
+
}
|
|
770
|
+
function Is(n, t) {
|
|
771
|
+
const s = (n[2] - n[0]) / 2 * (t - 1), e = (n[3] - n[1]) / 2 * (t - 1);
|
|
772
|
+
n[0] -= s, n[2] += s, n[1] -= e, n[3] += e;
|
|
773
|
+
}
|
|
774
|
+
function Os(n, t, s) {
|
|
775
|
+
let e = !1;
|
|
776
|
+
const r = dn(n, t), i = dn(n, s);
|
|
777
|
+
if (r === E.INTERSECTING || i === E.INTERSECTING)
|
|
778
|
+
e = !0;
|
|
779
|
+
else {
|
|
780
|
+
const o = n[0], a = n[1], c = n[2], l = n[3], f = t[0], h = t[1], u = s[0], g = s[1], d = (g - h) / (u - f);
|
|
781
|
+
let _, m;
|
|
782
|
+
i & E.ABOVE && !(r & E.ABOVE) && (_ = u - (g - l) / d, e = _ >= o && _ <= c), !e && i & E.RIGHT && !(r & E.RIGHT) && (m = g - (u - c) * d, e = m >= a && m <= l), !e && i & E.BELOW && !(r & E.BELOW) && (_ = u - (g - a) / d, e = _ >= o && _ <= c), !e && i & E.LEFT && !(r & E.LEFT) && (m = g - (u - o) * d, e = m >= a && m <= l);
|
|
783
|
+
}
|
|
784
|
+
return e;
|
|
785
|
+
}
|
|
786
|
+
function lt(n, t, s, e) {
|
|
787
|
+
if (Un(n))
|
|
788
|
+
return nn(s);
|
|
789
|
+
let r = [];
|
|
790
|
+
r = [
|
|
791
|
+
n[0],
|
|
792
|
+
n[1],
|
|
793
|
+
n[2],
|
|
794
|
+
n[1],
|
|
795
|
+
n[2],
|
|
796
|
+
n[3],
|
|
797
|
+
n[0],
|
|
798
|
+
n[3]
|
|
799
|
+
], t(r, r, 2);
|
|
800
|
+
const i = [], o = [];
|
|
801
|
+
for (let a = 0, c = r.length; a < c; a += 2)
|
|
802
|
+
i.push(r[a]), o.push(r[a + 1]);
|
|
803
|
+
return nt(i, o, s);
|
|
804
|
+
}
|
|
805
|
+
function ft(n, t) {
|
|
806
|
+
const s = t.getExtent(), e = it(n);
|
|
807
|
+
if (t.canWrapX() && (e[0] < s[0] || e[0] >= s[2])) {
|
|
808
|
+
const r = O(s), o = Math.floor(
|
|
809
|
+
(e[0] - s[0]) / r
|
|
810
|
+
) * r;
|
|
811
|
+
n[0] -= o, n[2] -= o;
|
|
812
|
+
}
|
|
813
|
+
return n;
|
|
814
|
+
}
|
|
815
|
+
function Gs(n, t, s) {
|
|
816
|
+
if (t.canWrapX()) {
|
|
817
|
+
const e = t.getExtent();
|
|
818
|
+
if (!isFinite(n[0]) || !isFinite(n[2]))
|
|
819
|
+
return [[e[0], n[1], e[2], n[3]]];
|
|
820
|
+
ft(n, t);
|
|
821
|
+
const r = O(e);
|
|
822
|
+
if (O(n) > r && !s)
|
|
823
|
+
return [[e[0], n[1], e[2], n[3]]];
|
|
824
|
+
if (n[0] < e[0])
|
|
825
|
+
return [
|
|
826
|
+
[n[0] + r, n[1], e[2], n[3]],
|
|
827
|
+
[e[0], n[1], n[2], n[3]]
|
|
828
|
+
];
|
|
829
|
+
if (n[2] > e[2])
|
|
830
|
+
return [
|
|
831
|
+
[n[0], n[1], e[2], n[3]],
|
|
832
|
+
[e[0], n[1], n[2] - r, n[3]]
|
|
833
|
+
];
|
|
834
|
+
}
|
|
835
|
+
return [n];
|
|
836
|
+
}
|
|
837
|
+
function Ls(n, t) {
|
|
838
|
+
return n[0] += +t[0], n[1] += +t[1], n;
|
|
839
|
+
}
|
|
840
|
+
function ut(n, t) {
|
|
841
|
+
const s = n[0], e = n[1], r = t[0], i = t[1], o = r[0], a = r[1], c = i[0], l = i[1], f = c - o, h = l - a, u = f === 0 && h === 0 ? 0 : (f * (s - o) + h * (e - a)) / (f * f + h * h || 0);
|
|
842
|
+
let g, d;
|
|
843
|
+
return u <= 0 ? (g = o, d = a) : u >= 1 ? (g = c, d = l) : (g = o + u * f, d = a + u * h), [g, d];
|
|
844
|
+
}
|
|
845
|
+
function ht(n, t) {
|
|
846
|
+
let s = !0;
|
|
847
|
+
for (let e = n.length - 1; e >= 0; --e)
|
|
848
|
+
if (n[e] != t[e]) {
|
|
849
|
+
s = !1;
|
|
850
|
+
break;
|
|
851
|
+
}
|
|
852
|
+
return s;
|
|
853
|
+
}
|
|
854
|
+
function As(n, t) {
|
|
855
|
+
const s = Math.cos(t), e = Math.sin(t), r = n[0] * s - n[1] * e, i = n[1] * s + n[0] * e;
|
|
856
|
+
return n[0] = r, n[1] = i, n;
|
|
857
|
+
}
|
|
858
|
+
function Us(n, t) {
|
|
859
|
+
return n[0] *= t, n[1] *= t, n;
|
|
860
|
+
}
|
|
861
|
+
function bn(n, t) {
|
|
862
|
+
const s = n[0] - t[0], e = n[1] - t[1];
|
|
863
|
+
return s * s + e * e;
|
|
864
|
+
}
|
|
865
|
+
function bs(n, t) {
|
|
866
|
+
return Math.sqrt(bn(n, t));
|
|
867
|
+
}
|
|
868
|
+
function Ns(n, t) {
|
|
869
|
+
return bn(n, ut(n, t));
|
|
870
|
+
}
|
|
871
|
+
function Fs(n, t) {
|
|
872
|
+
if (t.canWrapX()) {
|
|
873
|
+
const s = O(t.getExtent()), e = gt(n, t, s);
|
|
874
|
+
e && (n[0] -= e * s);
|
|
875
|
+
}
|
|
876
|
+
return n;
|
|
877
|
+
}
|
|
878
|
+
function gt(n, t, s) {
|
|
879
|
+
const e = t.getExtent();
|
|
880
|
+
let r = 0;
|
|
881
|
+
return t.canWrapX() && (n[0] < e[0] || n[0] > e[2]) && (s = s || O(e), r = Math.floor(
|
|
882
|
+
(n[0] - e[0]) / s
|
|
883
|
+
)), r;
|
|
884
|
+
}
|
|
885
|
+
const Nn = 63710088e-1;
|
|
886
|
+
function En(n, t, s) {
|
|
887
|
+
s = s || Nn;
|
|
888
|
+
const e = M(n[1]), r = M(t[1]), i = (r - e) / 2, o = M(t[0] - n[0]) / 2, a = Math.sin(i) * Math.sin(i) + Math.sin(o) * Math.sin(o) * Math.cos(e) * Math.cos(r);
|
|
889
|
+
return 2 * s * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
890
|
+
}
|
|
891
|
+
function F(n, t) {
|
|
892
|
+
let s = 0;
|
|
893
|
+
const e = n.length;
|
|
894
|
+
let r = n[e - 1][0], i = n[e - 1][1];
|
|
895
|
+
for (let o = 0; o < e; o++) {
|
|
896
|
+
const a = n[o][0], c = n[o][1];
|
|
897
|
+
s += M(a - r) * (2 + Math.sin(M(i)) + Math.sin(M(c))), r = a, i = c;
|
|
898
|
+
}
|
|
899
|
+
return s * t * t / 2;
|
|
900
|
+
}
|
|
901
|
+
function dt(n, t) {
|
|
902
|
+
t = t || {};
|
|
903
|
+
const s = t.radius || Nn, e = t.projection || "EPSG:3857", r = n.getType();
|
|
904
|
+
r !== "GeometryCollection" && (n = n.clone().transform(e, "EPSG:4326"));
|
|
905
|
+
let i = 0, o, a, c, l, f, h;
|
|
906
|
+
switch (r) {
|
|
907
|
+
case "Point":
|
|
908
|
+
case "MultiPoint":
|
|
909
|
+
case "LineString":
|
|
910
|
+
case "MultiLineString":
|
|
911
|
+
case "LinearRing":
|
|
912
|
+
break;
|
|
913
|
+
case "Polygon": {
|
|
914
|
+
for (o = /** @type {import("./geom/Polygon.js").default} */
|
|
915
|
+
n.getCoordinates(), i = Math.abs(F(o[0], s)), c = 1, l = o.length; c < l; ++c)
|
|
916
|
+
i -= Math.abs(F(o[c], s));
|
|
917
|
+
break;
|
|
918
|
+
}
|
|
919
|
+
case "MultiPolygon": {
|
|
920
|
+
for (o = /** @type {import("./geom/SimpleGeometry.js").default} */
|
|
921
|
+
n.getCoordinates(), c = 0, l = o.length; c < l; ++c)
|
|
922
|
+
for (a = o[c], i += Math.abs(F(a[0], s)), f = 1, h = a.length; f < h; ++f)
|
|
923
|
+
i -= Math.abs(F(a[f], s));
|
|
924
|
+
break;
|
|
925
|
+
}
|
|
926
|
+
case "GeometryCollection": {
|
|
927
|
+
const u = (
|
|
928
|
+
/** @type {import("./geom/GeometryCollection.js").default} */
|
|
929
|
+
n.getGeometries()
|
|
930
|
+
);
|
|
931
|
+
for (c = 0, l = u.length; c < l; ++c)
|
|
932
|
+
i += dt(u[c], t);
|
|
933
|
+
break;
|
|
934
|
+
}
|
|
935
|
+
default:
|
|
936
|
+
throw new Error("Unsupported geometry type: " + r);
|
|
937
|
+
}
|
|
938
|
+
return i;
|
|
939
|
+
}
|
|
940
|
+
function Et(...n) {
|
|
941
|
+
console.warn(...n);
|
|
942
|
+
}
|
|
943
|
+
const k = {
|
|
944
|
+
// use the radius of the Normal sphere
|
|
945
|
+
radians: 6370997 / (2 * Math.PI),
|
|
946
|
+
degrees: 2 * Math.PI * 6370997 / 360,
|
|
947
|
+
ft: 0.3048,
|
|
948
|
+
m: 1,
|
|
949
|
+
"us-ft": 1200 / 3937
|
|
950
|
+
};
|
|
951
|
+
class tn {
|
|
952
|
+
/**
|
|
953
|
+
* @param {Options} options Projection options.
|
|
954
|
+
*/
|
|
955
|
+
constructor(t) {
|
|
956
|
+
this.code_ = t.code, this.units_ = /** @type {import("./Units.js").Units} */
|
|
957
|
+
t.units, this.extent_ = t.extent !== void 0 ? t.extent : null, this.worldExtent_ = t.worldExtent !== void 0 ? t.worldExtent : null, this.axisOrientation_ = t.axisOrientation !== void 0 ? t.axisOrientation : "enu", this.global_ = t.global !== void 0 ? t.global : !1, this.canWrapX_ = !!(this.global_ && this.extent_), this.getPointResolutionFunc_ = t.getPointResolution, this.defaultTileGrid_ = null, this.metersPerUnit_ = t.metersPerUnit;
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* @return {boolean} The projection is suitable for wrapping the x-axis
|
|
961
|
+
*/
|
|
962
|
+
canWrapX() {
|
|
963
|
+
return this.canWrapX_;
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* Get the code for this projection, e.g. 'EPSG:4326'.
|
|
967
|
+
* @return {string} Code.
|
|
968
|
+
* @api
|
|
969
|
+
*/
|
|
970
|
+
getCode() {
|
|
971
|
+
return this.code_;
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Get the validity extent for this projection.
|
|
975
|
+
* @return {import("../extent.js").Extent} Extent.
|
|
976
|
+
* @api
|
|
977
|
+
*/
|
|
978
|
+
getExtent() {
|
|
979
|
+
return this.extent_;
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* Get the units of this projection.
|
|
983
|
+
* @return {import("./Units.js").Units} Units.
|
|
984
|
+
* @api
|
|
985
|
+
*/
|
|
986
|
+
getUnits() {
|
|
987
|
+
return this.units_;
|
|
988
|
+
}
|
|
989
|
+
/**
|
|
990
|
+
* Get the amount of meters per unit of this projection. If the projection is
|
|
991
|
+
* not configured with `metersPerUnit` or a units identifier, the return is
|
|
992
|
+
* `undefined`.
|
|
993
|
+
* @return {number|undefined} Meters.
|
|
994
|
+
* @api
|
|
995
|
+
*/
|
|
996
|
+
getMetersPerUnit() {
|
|
997
|
+
return this.metersPerUnit_ || k[this.units_];
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* Get the world extent for this projection.
|
|
1001
|
+
* @return {import("../extent.js").Extent} Extent.
|
|
1002
|
+
* @api
|
|
1003
|
+
*/
|
|
1004
|
+
getWorldExtent() {
|
|
1005
|
+
return this.worldExtent_;
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* Get the axis orientation of this projection.
|
|
1009
|
+
* Example values are:
|
|
1010
|
+
* enu - the default easting, northing, elevation.
|
|
1011
|
+
* neu - northing, easting, up - useful for "lat/long" geographic coordinates,
|
|
1012
|
+
* or south orientated transverse mercator.
|
|
1013
|
+
* wnu - westing, northing, up - some planetary coordinate systems have
|
|
1014
|
+
* "west positive" coordinate systems
|
|
1015
|
+
* @return {string} Axis orientation.
|
|
1016
|
+
* @api
|
|
1017
|
+
*/
|
|
1018
|
+
getAxisOrientation() {
|
|
1019
|
+
return this.axisOrientation_;
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* Is this projection a global projection which spans the whole world?
|
|
1023
|
+
* @return {boolean} Whether the projection is global.
|
|
1024
|
+
* @api
|
|
1025
|
+
*/
|
|
1026
|
+
isGlobal() {
|
|
1027
|
+
return this.global_;
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* Set if the projection is a global projection which spans the whole world
|
|
1031
|
+
* @param {boolean} global Whether the projection is global.
|
|
1032
|
+
* @api
|
|
1033
|
+
*/
|
|
1034
|
+
setGlobal(t) {
|
|
1035
|
+
this.global_ = t, this.canWrapX_ = !!(t && this.extent_);
|
|
1036
|
+
}
|
|
1037
|
+
/**
|
|
1038
|
+
* @return {import("../tilegrid/TileGrid.js").default} The default tile grid.
|
|
1039
|
+
*/
|
|
1040
|
+
getDefaultTileGrid() {
|
|
1041
|
+
return this.defaultTileGrid_;
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* @param {import("../tilegrid/TileGrid.js").default} tileGrid The default tile grid.
|
|
1045
|
+
*/
|
|
1046
|
+
setDefaultTileGrid(t) {
|
|
1047
|
+
this.defaultTileGrid_ = t;
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Set the validity extent for this projection.
|
|
1051
|
+
* @param {import("../extent.js").Extent} extent Extent.
|
|
1052
|
+
* @api
|
|
1053
|
+
*/
|
|
1054
|
+
setExtent(t) {
|
|
1055
|
+
this.extent_ = t, this.canWrapX_ = !!(this.global_ && t);
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* Set the world extent for this projection.
|
|
1059
|
+
* @param {import("../extent.js").Extent} worldExtent World extent
|
|
1060
|
+
* [minlon, minlat, maxlon, maxlat].
|
|
1061
|
+
* @api
|
|
1062
|
+
*/
|
|
1063
|
+
setWorldExtent(t) {
|
|
1064
|
+
this.worldExtent_ = t;
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* Set the getPointResolution function (see {@link module:ol/proj.getPointResolution}
|
|
1068
|
+
* for this projection.
|
|
1069
|
+
* @param {function(number, import("../coordinate.js").Coordinate):number} func Function
|
|
1070
|
+
* @api
|
|
1071
|
+
*/
|
|
1072
|
+
setGetPointResolution(t) {
|
|
1073
|
+
this.getPointResolutionFunc_ = t;
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* Get the custom point resolution function for this projection (if set).
|
|
1077
|
+
* @return {GetPointResolution|undefined} The custom point
|
|
1078
|
+
* resolution function (if set).
|
|
1079
|
+
*/
|
|
1080
|
+
getPointResolutionFunc() {
|
|
1081
|
+
return this.getPointResolutionFunc_;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
const U = 6378137, C = Math.PI * U, Pt = [-C, -C, C, C], _t = [-180, -85, 180, 85], X = U * Math.log(Math.tan(Math.PI / 2));
|
|
1085
|
+
class R extends tn {
|
|
1086
|
+
/**
|
|
1087
|
+
* @param {string} code Code.
|
|
1088
|
+
*/
|
|
1089
|
+
constructor(t) {
|
|
1090
|
+
super({
|
|
1091
|
+
code: t,
|
|
1092
|
+
units: "m",
|
|
1093
|
+
extent: Pt,
|
|
1094
|
+
global: !0,
|
|
1095
|
+
worldExtent: _t,
|
|
1096
|
+
getPointResolution: function(s, e) {
|
|
1097
|
+
return s / Math.cosh(e[1] / U);
|
|
1098
|
+
}
|
|
1099
|
+
});
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
const Pn = [
|
|
1103
|
+
new R("EPSG:3857"),
|
|
1104
|
+
new R("EPSG:102100"),
|
|
1105
|
+
new R("EPSG:102113"),
|
|
1106
|
+
new R("EPSG:900913"),
|
|
1107
|
+
new R("http://www.opengis.net/def/crs/EPSG/0/3857"),
|
|
1108
|
+
new R("http://www.opengis.net/gml/srs/epsg.xml#3857")
|
|
1109
|
+
];
|
|
1110
|
+
function mt(n, t, s, e) {
|
|
1111
|
+
const r = n.length;
|
|
1112
|
+
s = s > 1 ? s : 2, e = e ?? s, t === void 0 && (s > 2 ? t = n.slice() : t = new Array(r));
|
|
1113
|
+
for (let i = 0; i < r; i += e) {
|
|
1114
|
+
t[i] = C * n[i] / 180;
|
|
1115
|
+
let o = U * Math.log(Math.tan(Math.PI * (+n[i + 1] + 90) / 360));
|
|
1116
|
+
o > X ? o = X : o < -X && (o = -X), t[i + 1] = o;
|
|
1117
|
+
}
|
|
1118
|
+
return t;
|
|
1119
|
+
}
|
|
1120
|
+
function Mt(n, t, s, e) {
|
|
1121
|
+
const r = n.length;
|
|
1122
|
+
s = s > 1 ? s : 2, e = e ?? s, t === void 0 && (s > 2 ? t = n.slice() : t = new Array(r));
|
|
1123
|
+
for (let i = 0; i < r; i += e)
|
|
1124
|
+
t[i] = 180 * n[i] / C, t[i + 1] = 360 * Math.atan(Math.exp(n[i + 1] / U)) / Math.PI - 90;
|
|
1125
|
+
return t;
|
|
1126
|
+
}
|
|
1127
|
+
const wt = 6378137, _n = [-180, -90, 180, 90], Tt = Math.PI * wt / 180;
|
|
1128
|
+
class y extends tn {
|
|
1129
|
+
/**
|
|
1130
|
+
* @param {string} code Code.
|
|
1131
|
+
* @param {string} [axisOrientation] Axis orientation.
|
|
1132
|
+
*/
|
|
1133
|
+
constructor(t, s) {
|
|
1134
|
+
super({
|
|
1135
|
+
code: t,
|
|
1136
|
+
units: "degrees",
|
|
1137
|
+
extent: _n,
|
|
1138
|
+
axisOrientation: s,
|
|
1139
|
+
global: !0,
|
|
1140
|
+
metersPerUnit: Tt,
|
|
1141
|
+
worldExtent: _n
|
|
1142
|
+
});
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
const mn = [
|
|
1146
|
+
new y("CRS:84"),
|
|
1147
|
+
new y("EPSG:4326", "neu"),
|
|
1148
|
+
new y("urn:ogc:def:crs:OGC:1.3:CRS84"),
|
|
1149
|
+
new y("urn:ogc:def:crs:OGC:2:84"),
|
|
1150
|
+
new y("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),
|
|
1151
|
+
new y("http://www.opengis.net/gml/srs/epsg.xml#4326", "neu"),
|
|
1152
|
+
new y("http://www.opengis.net/def/crs/EPSG/0/4326", "neu")
|
|
1153
|
+
];
|
|
1154
|
+
let J = {};
|
|
1155
|
+
function pt(n) {
|
|
1156
|
+
return J[n] || J[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/, "EPSG:$3")] || null;
|
|
1157
|
+
}
|
|
1158
|
+
function yt(n, t) {
|
|
1159
|
+
J[n] = t;
|
|
1160
|
+
}
|
|
1161
|
+
let I = {};
|
|
1162
|
+
function S(n, t, s) {
|
|
1163
|
+
const e = n.getCode(), r = t.getCode();
|
|
1164
|
+
e in I || (I[e] = {}), I[e][r] = s;
|
|
1165
|
+
}
|
|
1166
|
+
function K(n, t) {
|
|
1167
|
+
return n in I && t in I[n] ? I[n][t] : null;
|
|
1168
|
+
}
|
|
1169
|
+
const W = 0.9996, P = 669438e-8, B = P * P, Y = B * P, v = P / (1 - P), Mn = Math.sqrt(1 - P), G = (1 - Mn) / (1 + Mn), Fn = G * G, sn = Fn * G, en = sn * G, Xn = en * G, Wn = 1 - P / 4 - 3 * B / 64 - 5 * Y / 256, vt = 3 * P / 8 + 3 * B / 32 + 45 * Y / 1024, St = 15 * B / 256 + 45 * Y / 1024, Rt = 35 * Y / 3072, Ct = 3 / 2 * G - 27 / 32 * sn + 269 / 512 * Xn, It = 21 / 16 * Fn - 55 / 32 * en, Ot = 151 / 96 * sn - 417 / 128 * Xn, Gt = 1097 / 512 * en, D = 6378137;
|
|
1170
|
+
function Lt(n, t, s) {
|
|
1171
|
+
const e = n - 5e5, o = (s.north ? t : t - 1e7) / W / (D * Wn), a = o + Ct * Math.sin(2 * o) + It * Math.sin(4 * o) + Ot * Math.sin(6 * o) + Gt * Math.sin(8 * o), c = Math.sin(a), l = c * c, f = Math.cos(a), h = c / f, u = h * h, g = u * u, d = 1 - P * l, _ = Math.sqrt(1 - P * l), m = D / _, b = (1 - P) / d, T = v * f ** 2, L = T * T, p = e / (m * W), N = p * p, A = N * p, an = A * p, cn = an * p, Bn = cn * p, Yn = a - h / b * (N / 2 - an / 24 * (5 + 3 * u + 10 * T - 4 * L - 9 * v)) + Bn / 720 * (61 + 90 * u + 298 * T + 45 * g - 252 * v - 3 * L);
|
|
1172
|
+
let H = (p - A / 6 * (1 + 2 * u + T) + cn / 120 * (5 - 2 * T + 28 * u - 3 * L + 8 * v + 24 * g)) / f;
|
|
1173
|
+
return H = z(
|
|
1174
|
+
H + M(Dn(s.number)),
|
|
1175
|
+
-Math.PI,
|
|
1176
|
+
Math.PI
|
|
1177
|
+
), [gn(H), gn(Yn)];
|
|
1178
|
+
}
|
|
1179
|
+
const wn = -80, Tn = 84, At = -180, Ut = 180;
|
|
1180
|
+
function bt(n, t, s) {
|
|
1181
|
+
n = z(n, At, Ut), t < wn ? t = wn : t > Tn && (t = Tn);
|
|
1182
|
+
const e = M(t), r = Math.sin(e), i = Math.cos(e), o = r / i, a = o * o, c = a * a, l = M(n), f = Dn(s.number), h = M(f), u = D / Math.sqrt(1 - P * r ** 2), g = v * i ** 2, d = i * z(l - h, -Math.PI, Math.PI), _ = d * d, m = _ * d, b = m * d, T = b * d, L = T * d, p = D * (Wn * e - vt * Math.sin(2 * e) + St * Math.sin(4 * e) - Rt * Math.sin(6 * e)), N = W * u * (d + m / 6 * (1 - a + g) + T / 120 * (5 - 18 * a + c + 72 * g - 58 * v)) + 5e5;
|
|
1183
|
+
let A = W * (p + u * o * (_ / 2 + b / 24 * (5 - a + 9 * g + 4 * g ** 2) + L / 720 * (61 - 58 * a + c + 600 * g - 330 * v)));
|
|
1184
|
+
return s.north || (A += 1e7), [N, A];
|
|
1185
|
+
}
|
|
1186
|
+
function Dn(n) {
|
|
1187
|
+
return (n - 1) * 6 - 180 + 3;
|
|
1188
|
+
}
|
|
1189
|
+
const Nt = [
|
|
1190
|
+
/^EPSG:(\d+)$/,
|
|
1191
|
+
/^urn:ogc:def:crs:EPSG::(\d+)$/,
|
|
1192
|
+
/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/
|
|
1193
|
+
];
|
|
1194
|
+
function $n(n) {
|
|
1195
|
+
let t = 0;
|
|
1196
|
+
for (const r of Nt) {
|
|
1197
|
+
const i = n.match(r);
|
|
1198
|
+
if (i) {
|
|
1199
|
+
t = parseInt(i[1]);
|
|
1200
|
+
break;
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
if (!t)
|
|
1204
|
+
return null;
|
|
1205
|
+
let s = 0, e = !1;
|
|
1206
|
+
return t > 32700 && t < 32761 ? s = t - 32700 : t > 32600 && t < 32661 && (e = !0, s = t - 32600), s ? { number: s, north: e } : null;
|
|
1207
|
+
}
|
|
1208
|
+
function pn(n, t) {
|
|
1209
|
+
return function(s, e, r, i) {
|
|
1210
|
+
const o = s.length;
|
|
1211
|
+
r = r > 1 ? r : 2, i = i ?? r, e || (r > 2 ? e = s.slice() : e = new Array(o));
|
|
1212
|
+
for (let a = 0; a < o; a += i) {
|
|
1213
|
+
const c = s[a], l = s[a + 1], f = n(c, l, t);
|
|
1214
|
+
e[a] = f[0], e[a + 1] = f[1];
|
|
1215
|
+
}
|
|
1216
|
+
return e;
|
|
1217
|
+
};
|
|
1218
|
+
}
|
|
1219
|
+
function Ft(n) {
|
|
1220
|
+
return $n(n) ? new tn({ code: n, units: "m" }) : null;
|
|
1221
|
+
}
|
|
1222
|
+
function Xt(n) {
|
|
1223
|
+
const t = $n(n.getCode());
|
|
1224
|
+
return t ? {
|
|
1225
|
+
forward: pn(bt, t),
|
|
1226
|
+
inverse: pn(Lt, t)
|
|
1227
|
+
} : null;
|
|
1228
|
+
}
|
|
1229
|
+
const Wt = [Xt], Dt = [Ft];
|
|
1230
|
+
let Q = !0;
|
|
1231
|
+
function $t(n) {
|
|
1232
|
+
Q = !1;
|
|
1233
|
+
}
|
|
1234
|
+
function rn(n, t) {
|
|
1235
|
+
if (t !== void 0) {
|
|
1236
|
+
for (let s = 0, e = n.length; s < e; ++s)
|
|
1237
|
+
t[s] = n[s];
|
|
1238
|
+
t = t;
|
|
1239
|
+
} else
|
|
1240
|
+
t = n.slice();
|
|
1241
|
+
return t;
|
|
1242
|
+
}
|
|
1243
|
+
function Z(n) {
|
|
1244
|
+
yt(n.getCode(), n), S(n, n, rn);
|
|
1245
|
+
}
|
|
1246
|
+
function qt(n) {
|
|
1247
|
+
n.forEach(Z);
|
|
1248
|
+
}
|
|
1249
|
+
function w(n) {
|
|
1250
|
+
if (typeof n != "string")
|
|
1251
|
+
return n;
|
|
1252
|
+
const t = pt(n);
|
|
1253
|
+
if (t)
|
|
1254
|
+
return t;
|
|
1255
|
+
for (const s of Dt) {
|
|
1256
|
+
const e = s(n);
|
|
1257
|
+
if (e)
|
|
1258
|
+
return e;
|
|
1259
|
+
}
|
|
1260
|
+
return null;
|
|
1261
|
+
}
|
|
1262
|
+
function Xs(n, t, s, e) {
|
|
1263
|
+
n = w(n);
|
|
1264
|
+
let r;
|
|
1265
|
+
const i = n.getPointResolutionFunc();
|
|
1266
|
+
if (i) {
|
|
1267
|
+
if (r = i(t, s), e && e !== n.getUnits()) {
|
|
1268
|
+
const o = n.getMetersPerUnit();
|
|
1269
|
+
o && (r = r * o / k[e]);
|
|
1270
|
+
}
|
|
1271
|
+
} else {
|
|
1272
|
+
const o = n.getUnits();
|
|
1273
|
+
if (o == "degrees" && !e || e == "degrees")
|
|
1274
|
+
r = t;
|
|
1275
|
+
else {
|
|
1276
|
+
const a = on(
|
|
1277
|
+
n,
|
|
1278
|
+
w("EPSG:4326")
|
|
1279
|
+
);
|
|
1280
|
+
if (!a && o !== "degrees")
|
|
1281
|
+
r = t * n.getMetersPerUnit();
|
|
1282
|
+
else {
|
|
1283
|
+
let l = [
|
|
1284
|
+
s[0] - t / 2,
|
|
1285
|
+
s[1],
|
|
1286
|
+
s[0] + t / 2,
|
|
1287
|
+
s[1],
|
|
1288
|
+
s[0],
|
|
1289
|
+
s[1] - t / 2,
|
|
1290
|
+
s[0],
|
|
1291
|
+
s[1] + t / 2
|
|
1292
|
+
];
|
|
1293
|
+
l = a(l, l, 2);
|
|
1294
|
+
const f = En(l.slice(0, 2), l.slice(2, 4)), h = En(l.slice(4, 6), l.slice(6, 8));
|
|
1295
|
+
r = (f + h) / 2;
|
|
1296
|
+
}
|
|
1297
|
+
const c = e ? k[e] : n.getMetersPerUnit();
|
|
1298
|
+
c !== void 0 && (r /= c);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
return r;
|
|
1302
|
+
}
|
|
1303
|
+
function yn(n) {
|
|
1304
|
+
qt(n), n.forEach(function(t) {
|
|
1305
|
+
n.forEach(function(s) {
|
|
1306
|
+
t !== s && S(t, s, rn);
|
|
1307
|
+
});
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
function Bt(n, t, s, e) {
|
|
1311
|
+
n.forEach(function(r) {
|
|
1312
|
+
t.forEach(function(i) {
|
|
1313
|
+
S(r, i, s), S(i, r, e);
|
|
1314
|
+
});
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
function Ws(n, t) {
|
|
1318
|
+
return n ? typeof n == "string" ? w(n) : (
|
|
1319
|
+
/** @type {Projection} */
|
|
1320
|
+
n
|
|
1321
|
+
) : w(t);
|
|
1322
|
+
}
|
|
1323
|
+
function vn(n) {
|
|
1324
|
+
return (
|
|
1325
|
+
/**
|
|
1326
|
+
* @param {Array<number>} input Input.
|
|
1327
|
+
* @param {Array<number>} [output] Output.
|
|
1328
|
+
* @param {number} [dimension] Dimensions that should be transformed.
|
|
1329
|
+
* @param {number} [stride] Stride.
|
|
1330
|
+
* @return {Array<number>} Output.
|
|
1331
|
+
*/
|
|
1332
|
+
(function(t, s, e, r) {
|
|
1333
|
+
const i = t.length;
|
|
1334
|
+
e = e !== void 0 ? e : 2, r = r ?? e, s = s !== void 0 ? s : new Array(i);
|
|
1335
|
+
for (let o = 0; o < i; o += r) {
|
|
1336
|
+
const a = n(t.slice(o, o + e)), c = a.length;
|
|
1337
|
+
for (let l = 0, f = r; l < f; ++l)
|
|
1338
|
+
s[o + l] = l >= c ? t[o + l] : a[l];
|
|
1339
|
+
}
|
|
1340
|
+
return s;
|
|
1341
|
+
})
|
|
1342
|
+
);
|
|
1343
|
+
}
|
|
1344
|
+
function Ds(n, t, s, e) {
|
|
1345
|
+
const r = w(n), i = w(t);
|
|
1346
|
+
S(
|
|
1347
|
+
r,
|
|
1348
|
+
i,
|
|
1349
|
+
vn(s)
|
|
1350
|
+
), S(
|
|
1351
|
+
i,
|
|
1352
|
+
r,
|
|
1353
|
+
vn(e)
|
|
1354
|
+
);
|
|
1355
|
+
}
|
|
1356
|
+
function $s(n, t) {
|
|
1357
|
+
return $t(), Yt(
|
|
1358
|
+
n,
|
|
1359
|
+
"EPSG:4326",
|
|
1360
|
+
t !== void 0 ? t : "EPSG:3857"
|
|
1361
|
+
);
|
|
1362
|
+
}
|
|
1363
|
+
function qs(n, t) {
|
|
1364
|
+
if (n === t)
|
|
1365
|
+
return !0;
|
|
1366
|
+
const s = n.getUnits() === t.getUnits();
|
|
1367
|
+
return (n.getCode() === t.getCode() || on(n, t) === rn) && s;
|
|
1368
|
+
}
|
|
1369
|
+
function on(n, t) {
|
|
1370
|
+
const s = n.getCode(), e = t.getCode();
|
|
1371
|
+
let r = K(s, e);
|
|
1372
|
+
if (r)
|
|
1373
|
+
return r;
|
|
1374
|
+
let i = null, o = null;
|
|
1375
|
+
for (const c of Wt)
|
|
1376
|
+
i || (i = c(n)), o || (o = c(t));
|
|
1377
|
+
if (!i && !o)
|
|
1378
|
+
return null;
|
|
1379
|
+
const a = "EPSG:4326";
|
|
1380
|
+
if (o)
|
|
1381
|
+
if (i)
|
|
1382
|
+
r = V(
|
|
1383
|
+
i.inverse,
|
|
1384
|
+
o.forward
|
|
1385
|
+
);
|
|
1386
|
+
else {
|
|
1387
|
+
const c = K(s, a);
|
|
1388
|
+
c && (r = V(
|
|
1389
|
+
c,
|
|
1390
|
+
o.forward
|
|
1391
|
+
));
|
|
1392
|
+
}
|
|
1393
|
+
else {
|
|
1394
|
+
const c = K(a, e);
|
|
1395
|
+
c && (r = V(
|
|
1396
|
+
i.inverse,
|
|
1397
|
+
c
|
|
1398
|
+
));
|
|
1399
|
+
}
|
|
1400
|
+
return r && (Z(n), Z(t), S(n, t, r)), r;
|
|
1401
|
+
}
|
|
1402
|
+
function V(n, t) {
|
|
1403
|
+
return function(s, e, r, i) {
|
|
1404
|
+
return e = n(s, e, r, i), t(e, e, r, i);
|
|
1405
|
+
};
|
|
1406
|
+
}
|
|
1407
|
+
function qn(n, t) {
|
|
1408
|
+
const s = w(n), e = w(t);
|
|
1409
|
+
return on(s, e);
|
|
1410
|
+
}
|
|
1411
|
+
function Yt(n, t, s) {
|
|
1412
|
+
const e = qn(t, s);
|
|
1413
|
+
if (!e) {
|
|
1414
|
+
const r = w(t).getCode(), i = w(s).getCode();
|
|
1415
|
+
throw new Error(
|
|
1416
|
+
`No transform available between ${r} and ${i}`
|
|
1417
|
+
);
|
|
1418
|
+
}
|
|
1419
|
+
return e(n, void 0, n.length);
|
|
1420
|
+
}
|
|
1421
|
+
function Bs(n, t, s, e) {
|
|
1422
|
+
const r = qn(t, s);
|
|
1423
|
+
return lt(n, r, void 0);
|
|
1424
|
+
}
|
|
1425
|
+
let Ht = null;
|
|
1426
|
+
function Ys() {
|
|
1427
|
+
return Ht;
|
|
1428
|
+
}
|
|
1429
|
+
function Hs(n, t) {
|
|
1430
|
+
return n;
|
|
1431
|
+
}
|
|
1432
|
+
function Ks(n, t) {
|
|
1433
|
+
return Q && !ht(n, [0, 0]) && n[0] >= -180 && n[0] <= 180 && n[1] >= -90 && n[1] <= 90 && (Q = !1, Et(
|
|
1434
|
+
"Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates."
|
|
1435
|
+
)), n;
|
|
1436
|
+
}
|
|
1437
|
+
function Vs(n, t) {
|
|
1438
|
+
return n;
|
|
1439
|
+
}
|
|
1440
|
+
function js(n, t) {
|
|
1441
|
+
return n;
|
|
1442
|
+
}
|
|
1443
|
+
function zs(n, t) {
|
|
1444
|
+
return n;
|
|
1445
|
+
}
|
|
1446
|
+
function Kt() {
|
|
1447
|
+
yn(Pn), yn(mn), Bt(
|
|
1448
|
+
mn,
|
|
1449
|
+
Pn,
|
|
1450
|
+
mt,
|
|
1451
|
+
Mt
|
|
1452
|
+
);
|
|
1453
|
+
}
|
|
1454
|
+
Kt();
|
|
1455
|
+
export {
|
|
1456
|
+
ds as $,
|
|
1457
|
+
ms as A,
|
|
1458
|
+
es as B,
|
|
1459
|
+
w as C,
|
|
1460
|
+
at as D,
|
|
1461
|
+
Kn as E,
|
|
1462
|
+
ns as F,
|
|
1463
|
+
ws as G,
|
|
1464
|
+
Gs as H,
|
|
1465
|
+
Cn as I,
|
|
1466
|
+
Un as J,
|
|
1467
|
+
O as K,
|
|
1468
|
+
zt as L,
|
|
1469
|
+
k as M,
|
|
1470
|
+
us as N,
|
|
1471
|
+
Hn as O,
|
|
1472
|
+
Ss as P,
|
|
1473
|
+
ls as Q,
|
|
1474
|
+
fs as R,
|
|
1475
|
+
Yt as S,
|
|
1476
|
+
Zt as T,
|
|
1477
|
+
as as U,
|
|
1478
|
+
ln as V,
|
|
1479
|
+
Ps as W,
|
|
1480
|
+
dn as X,
|
|
1481
|
+
E as Y,
|
|
1482
|
+
kt as Z,
|
|
1483
|
+
jn as _,
|
|
1484
|
+
Zn as a,
|
|
1485
|
+
st as a0,
|
|
1486
|
+
Sn as a1,
|
|
1487
|
+
jt as a2,
|
|
1488
|
+
x as a3,
|
|
1489
|
+
on as a4,
|
|
1490
|
+
Ys as a5,
|
|
1491
|
+
rs as a6,
|
|
1492
|
+
Fs as a7,
|
|
1493
|
+
ft as a8,
|
|
1494
|
+
xt as a9,
|
|
1495
|
+
Is as aA,
|
|
1496
|
+
fn as aB,
|
|
1497
|
+
kn as aC,
|
|
1498
|
+
Us as aD,
|
|
1499
|
+
As as aE,
|
|
1500
|
+
Vn as aF,
|
|
1501
|
+
Et as aG,
|
|
1502
|
+
$ as aH,
|
|
1503
|
+
An as aI,
|
|
1504
|
+
On as aJ,
|
|
1505
|
+
ot as aK,
|
|
1506
|
+
Cs as aL,
|
|
1507
|
+
is as aM,
|
|
1508
|
+
Ws as aN,
|
|
1509
|
+
Ls as aO,
|
|
1510
|
+
$t as aP,
|
|
1511
|
+
Qt as aQ,
|
|
1512
|
+
vs as aR,
|
|
1513
|
+
os as aS,
|
|
1514
|
+
vn as aT,
|
|
1515
|
+
ys as aU,
|
|
1516
|
+
et as aV,
|
|
1517
|
+
Os as aW,
|
|
1518
|
+
Ks as aa,
|
|
1519
|
+
bn as ab,
|
|
1520
|
+
hs as ac,
|
|
1521
|
+
bs as ad,
|
|
1522
|
+
ht as ae,
|
|
1523
|
+
Hs as af,
|
|
1524
|
+
ut as ag,
|
|
1525
|
+
Ns as ah,
|
|
1526
|
+
Rn as ai,
|
|
1527
|
+
qn as aj,
|
|
1528
|
+
ss as ak,
|
|
1529
|
+
M as al,
|
|
1530
|
+
Bs as am,
|
|
1531
|
+
Ln as an,
|
|
1532
|
+
lt as ao,
|
|
1533
|
+
tn as ap,
|
|
1534
|
+
ts as aq,
|
|
1535
|
+
$s as ar,
|
|
1536
|
+
Jn as as,
|
|
1537
|
+
Z as at,
|
|
1538
|
+
K as au,
|
|
1539
|
+
yn as av,
|
|
1540
|
+
Ds as aw,
|
|
1541
|
+
dt as ax,
|
|
1542
|
+
En as ay,
|
|
1543
|
+
Gn as az,
|
|
1544
|
+
gs as b,
|
|
1545
|
+
_s as c,
|
|
1546
|
+
Rs as d,
|
|
1547
|
+
qs as e,
|
|
1548
|
+
zn as f,
|
|
1549
|
+
Xs as g,
|
|
1550
|
+
zs as h,
|
|
1551
|
+
ct as i,
|
|
1552
|
+
js as j,
|
|
1553
|
+
Ms as k,
|
|
1554
|
+
j as l,
|
|
1555
|
+
In as m,
|
|
1556
|
+
cs as n,
|
|
1557
|
+
Vt as o,
|
|
1558
|
+
q as p,
|
|
1559
|
+
ps as q,
|
|
1560
|
+
Es as r,
|
|
1561
|
+
nn as s,
|
|
1562
|
+
Vs as t,
|
|
1563
|
+
un as u,
|
|
1564
|
+
Ts as v,
|
|
1565
|
+
it as w,
|
|
1566
|
+
Jt as x,
|
|
1567
|
+
xn as y,
|
|
1568
|
+
tt as z
|
|
1569
|
+
};
|