@neshan-maps-platform/react-openlayers 3.0.2 → 3.0.3-alpha.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Map as
|
|
3
|
-
var
|
|
1
|
+
import he, { forwardRef as ge, useRef as ee, useState as te, useImperativeHandle as Pe, useEffect as Re } from "react";
|
|
2
|
+
import { Map as we, View as Te } from "@neshan-maps-platform/ol";
|
|
3
|
+
var j = { exports: {} }, v = {};
|
|
4
4
|
/**
|
|
5
5
|
* @license React
|
|
6
6
|
* react-jsx-runtime.production.js
|
|
@@ -10,29 +10,29 @@ var G = { exports: {} }, O = {};
|
|
|
10
10
|
* This source code is licensed under the MIT license found in the
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
if (
|
|
16
|
-
|
|
13
|
+
var re;
|
|
14
|
+
function be() {
|
|
15
|
+
if (re) return v;
|
|
16
|
+
re = 1;
|
|
17
17
|
var r = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
18
|
-
function n(s,
|
|
19
|
-
var
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
for (var
|
|
23
|
-
|
|
24
|
-
} else
|
|
25
|
-
return
|
|
18
|
+
function n(s, o, l) {
|
|
19
|
+
var _ = null;
|
|
20
|
+
if (l !== void 0 && (_ = "" + l), o.key !== void 0 && (_ = "" + o.key), "key" in o) {
|
|
21
|
+
l = {};
|
|
22
|
+
for (var m in o)
|
|
23
|
+
m !== "key" && (l[m] = o[m]);
|
|
24
|
+
} else l = o;
|
|
25
|
+
return o = l.ref, {
|
|
26
26
|
$$typeof: r,
|
|
27
27
|
type: s,
|
|
28
|
-
key:
|
|
29
|
-
ref:
|
|
30
|
-
props:
|
|
28
|
+
key: _,
|
|
29
|
+
ref: o !== void 0 ? o : null,
|
|
30
|
+
props: l
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
return
|
|
33
|
+
return v.Fragment = t, v.jsx = n, v.jsxs = n, v;
|
|
34
34
|
}
|
|
35
|
-
var
|
|
35
|
+
var S = {};
|
|
36
36
|
/**
|
|
37
37
|
* @license React
|
|
38
38
|
* react-jsx-runtime.development.js
|
|
@@ -42,47 +42,47 @@ var A = {};
|
|
|
42
42
|
* This source code is licensed under the MIT license found in the
|
|
43
43
|
* LICENSE file in the root directory of this source tree.
|
|
44
44
|
*/
|
|
45
|
-
var
|
|
46
|
-
function
|
|
47
|
-
return
|
|
45
|
+
var ne;
|
|
46
|
+
function ve() {
|
|
47
|
+
return ne || (ne = 1, process.env.NODE_ENV !== "production" && function() {
|
|
48
48
|
function r(e) {
|
|
49
49
|
if (e == null) return null;
|
|
50
50
|
if (typeof e == "function")
|
|
51
|
-
return e.$$typeof ===
|
|
51
|
+
return e.$$typeof === Ee ? null : e.displayName || e.name || null;
|
|
52
52
|
if (typeof e == "string") return e;
|
|
53
53
|
switch (e) {
|
|
54
|
-
case
|
|
54
|
+
case h:
|
|
55
55
|
return "Fragment";
|
|
56
|
-
case
|
|
56
|
+
case A:
|
|
57
57
|
return "Profiler";
|
|
58
|
-
case
|
|
58
|
+
case F:
|
|
59
59
|
return "StrictMode";
|
|
60
|
-
case W:
|
|
61
|
-
return "Suspense";
|
|
62
60
|
case c:
|
|
61
|
+
return "Suspense";
|
|
62
|
+
case k:
|
|
63
63
|
return "SuspenseList";
|
|
64
|
-
case
|
|
64
|
+
case de:
|
|
65
65
|
return "Activity";
|
|
66
66
|
}
|
|
67
67
|
if (typeof e == "object")
|
|
68
68
|
switch (typeof e.tag == "number" && console.error(
|
|
69
69
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
70
70
|
), e.$$typeof) {
|
|
71
|
-
case
|
|
71
|
+
case $:
|
|
72
72
|
return "Portal";
|
|
73
73
|
case U:
|
|
74
|
-
return
|
|
75
|
-
case
|
|
74
|
+
return e.displayName || "Context";
|
|
75
|
+
case Y:
|
|
76
76
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
77
77
|
case D:
|
|
78
|
-
var
|
|
79
|
-
return e = e.displayName, e || (e =
|
|
80
|
-
case
|
|
81
|
-
return
|
|
82
|
-
case
|
|
83
|
-
|
|
78
|
+
var a = e.render;
|
|
79
|
+
return e = e.displayName, e || (e = a.displayName || a.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
80
|
+
case C:
|
|
81
|
+
return a = e.displayName || null, a !== null ? a : r(e.type) || "Memo";
|
|
82
|
+
case W:
|
|
83
|
+
a = e._payload, e = e._init;
|
|
84
84
|
try {
|
|
85
|
-
return r(e(
|
|
85
|
+
return r(e(a));
|
|
86
86
|
} catch {
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -94,73 +94,74 @@ function Se() {
|
|
|
94
94
|
function n(e) {
|
|
95
95
|
try {
|
|
96
96
|
t(e);
|
|
97
|
-
var
|
|
97
|
+
var a = !1;
|
|
98
98
|
} catch {
|
|
99
|
-
|
|
99
|
+
a = !0;
|
|
100
100
|
}
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
var
|
|
104
|
-
return
|
|
105
|
-
|
|
101
|
+
if (a) {
|
|
102
|
+
a = console;
|
|
103
|
+
var i = a.error, u = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
104
|
+
return i.call(
|
|
105
|
+
a,
|
|
106
106
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
107
107
|
u
|
|
108
108
|
), t(e);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
function s(e) {
|
|
112
|
-
if (e ===
|
|
113
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
112
|
+
if (e === h) return "<>";
|
|
113
|
+
if (typeof e == "object" && e !== null && e.$$typeof === W)
|
|
114
114
|
return "<...>";
|
|
115
115
|
try {
|
|
116
|
-
var
|
|
117
|
-
return
|
|
116
|
+
var a = r(e);
|
|
117
|
+
return a ? "<" + a + ">" : "<...>";
|
|
118
118
|
} catch {
|
|
119
119
|
return "<...>";
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function o() {
|
|
123
123
|
var e = X.A;
|
|
124
124
|
return e === null ? null : e.getOwner();
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function l() {
|
|
127
127
|
return Error("react-stack-top-frame");
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
if (
|
|
131
|
-
var
|
|
132
|
-
if (
|
|
129
|
+
function _(e) {
|
|
130
|
+
if (z.call(e, "key")) {
|
|
131
|
+
var a = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
132
|
+
if (a && a.isReactWarning) return !1;
|
|
133
133
|
}
|
|
134
134
|
return e.key !== void 0;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
function
|
|
138
|
-
|
|
136
|
+
function m(e, a) {
|
|
137
|
+
function i() {
|
|
138
|
+
B || (B = !0, console.error(
|
|
139
139
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
140
|
-
|
|
140
|
+
a
|
|
141
141
|
));
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
get:
|
|
143
|
+
i.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
144
|
+
get: i,
|
|
145
145
|
configurable: !0
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function O() {
|
|
149
149
|
var e = r(this.type);
|
|
150
|
-
return
|
|
150
|
+
return H[e] || (H[e] = !0, console.error(
|
|
151
151
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
152
152
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
function M(e, a, i, u, N, q) {
|
|
155
|
+
var f = i.ref;
|
|
156
|
+
return e = {
|
|
157
|
+
$$typeof: b,
|
|
157
158
|
type: e,
|
|
158
|
-
key:
|
|
159
|
-
props:
|
|
160
|
-
_owner:
|
|
161
|
-
}, (
|
|
159
|
+
key: a,
|
|
160
|
+
props: i,
|
|
161
|
+
_owner: u
|
|
162
|
+
}, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
|
|
162
163
|
enumerable: !1,
|
|
163
|
-
get:
|
|
164
|
+
get: O
|
|
164
165
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
165
166
|
configurable: !1,
|
|
166
167
|
enumerable: !1,
|
|
@@ -175,33 +176,33 @@ function Se() {
|
|
|
175
176
|
configurable: !1,
|
|
176
177
|
enumerable: !1,
|
|
177
178
|
writable: !0,
|
|
178
|
-
value:
|
|
179
|
+
value: N
|
|
179
180
|
}), Object.defineProperty(e, "_debugTask", {
|
|
180
181
|
configurable: !1,
|
|
181
182
|
enumerable: !1,
|
|
182
183
|
writable: !0,
|
|
183
|
-
value:
|
|
184
|
+
value: q
|
|
184
185
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
185
186
|
}
|
|
186
|
-
function
|
|
187
|
-
var f =
|
|
187
|
+
function p(e, a, i, u, N, q) {
|
|
188
|
+
var f = a.children;
|
|
188
189
|
if (f !== void 0)
|
|
189
190
|
if (u)
|
|
190
191
|
if (_e(f)) {
|
|
191
192
|
for (u = 0; u < f.length; u++)
|
|
192
|
-
|
|
193
|
+
y(f[u]);
|
|
193
194
|
Object.freeze && Object.freeze(f);
|
|
194
195
|
} else
|
|
195
196
|
console.error(
|
|
196
197
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
198
|
);
|
|
198
|
-
else
|
|
199
|
-
if (
|
|
199
|
+
else y(f);
|
|
200
|
+
if (z.call(a, "key")) {
|
|
200
201
|
f = r(e);
|
|
201
|
-
var
|
|
202
|
-
return
|
|
202
|
+
var P = Object.keys(a).filter(function(me) {
|
|
203
|
+
return me !== "key";
|
|
203
204
|
});
|
|
204
|
-
u = 0 <
|
|
205
|
+
u = 0 < P.length ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}", K[f + u] || (P = 0 < P.length ? "{" + P.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
206
|
`A props object containing a "key" prop is being spread into JSX:
|
|
206
207
|
let props = %s;
|
|
207
208
|
<%s {...props} />
|
|
@@ -210,79 +211,76 @@ React keys must be passed directly to JSX without using spread:
|
|
|
210
211
|
<%s key={someKey} {...props} />`,
|
|
211
212
|
u,
|
|
212
213
|
f,
|
|
213
|
-
|
|
214
|
+
P,
|
|
214
215
|
f
|
|
215
|
-
),
|
|
216
|
+
), K[f + u] = !0);
|
|
216
217
|
}
|
|
217
|
-
if (f = null,
|
|
218
|
-
|
|
219
|
-
for (var
|
|
220
|
-
|
|
221
|
-
} else
|
|
222
|
-
return f &&
|
|
223
|
-
|
|
218
|
+
if (f = null, i !== void 0 && (n(i), f = "" + i), _(a) && (n(a.key), f = "" + a.key), "key" in a) {
|
|
219
|
+
i = {};
|
|
220
|
+
for (var J in a)
|
|
221
|
+
J !== "key" && (i[J] = a[J]);
|
|
222
|
+
} else i = a;
|
|
223
|
+
return f && m(
|
|
224
|
+
i,
|
|
224
225
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
225
|
-
),
|
|
226
|
+
), M(
|
|
226
227
|
e,
|
|
227
228
|
f,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
q,
|
|
233
|
-
J
|
|
229
|
+
i,
|
|
230
|
+
o(),
|
|
231
|
+
N,
|
|
232
|
+
q
|
|
234
233
|
);
|
|
235
234
|
}
|
|
236
|
-
function
|
|
237
|
-
typeof e == "object" && e !== null && e.$$typeof ===
|
|
235
|
+
function y(e) {
|
|
236
|
+
E(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === W && (e._payload.status === "fulfilled" ? E(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
237
|
+
}
|
|
238
|
+
function E(e) {
|
|
239
|
+
return typeof e == "object" && e !== null && e.$$typeof === b;
|
|
238
240
|
}
|
|
239
|
-
var d =
|
|
241
|
+
var d = he, b = Symbol.for("react.transitional.element"), $ = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), F = Symbol.for("react.strict_mode"), A = Symbol.for("react.profiler"), Y = Symbol.for("react.consumer"), U = Symbol.for("react.context"), D = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), k = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), W = Symbol.for("react.lazy"), de = Symbol.for("react.activity"), Ee = Symbol.for("react.client.reference"), X = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, z = Object.prototype.hasOwnProperty, _e = Array.isArray, L = console.createTask ? console.createTask : function() {
|
|
240
242
|
return null;
|
|
241
243
|
};
|
|
242
244
|
d = {
|
|
243
|
-
|
|
245
|
+
react_stack_bottom_frame: function(e) {
|
|
244
246
|
return e();
|
|
245
247
|
}
|
|
246
248
|
};
|
|
247
|
-
var
|
|
249
|
+
var B, H = {}, Z = d.react_stack_bottom_frame.bind(
|
|
248
250
|
d,
|
|
249
|
-
|
|
250
|
-
)(),
|
|
251
|
-
|
|
252
|
-
var
|
|
253
|
-
return
|
|
251
|
+
l
|
|
252
|
+
)(), Q = L(s(l)), K = {};
|
|
253
|
+
S.Fragment = h, S.jsx = function(e, a, i) {
|
|
254
|
+
var u = 1e4 > X.recentlyCreatedOwnerStacks++;
|
|
255
|
+
return p(
|
|
254
256
|
e,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
+
a,
|
|
258
|
+
i,
|
|
257
259
|
!1,
|
|
258
|
-
u,
|
|
259
|
-
|
|
260
|
-
E ? Error("react-stack-top-frame") : Q,
|
|
261
|
-
E ? L(s(e)) : K
|
|
260
|
+
u ? Error("react-stack-top-frame") : Z,
|
|
261
|
+
u ? L(s(e)) : Q
|
|
262
262
|
);
|
|
263
|
-
},
|
|
264
|
-
var
|
|
265
|
-
return
|
|
263
|
+
}, S.jsxs = function(e, a, i) {
|
|
264
|
+
var u = 1e4 > X.recentlyCreatedOwnerStacks++;
|
|
265
|
+
return p(
|
|
266
266
|
e,
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
a,
|
|
268
|
+
i,
|
|
269
269
|
!0,
|
|
270
|
-
u,
|
|
271
|
-
|
|
272
|
-
E ? Error("react-stack-top-frame") : Q,
|
|
273
|
-
E ? L(s(e)) : K
|
|
270
|
+
u ? Error("react-stack-top-frame") : Z,
|
|
271
|
+
u ? L(s(e)) : Q
|
|
274
272
|
);
|
|
275
273
|
};
|
|
276
|
-
}()),
|
|
274
|
+
}()), S;
|
|
277
275
|
}
|
|
278
276
|
var ae;
|
|
279
|
-
function
|
|
280
|
-
return ae || (ae = 1, process.env.NODE_ENV === "production" ?
|
|
277
|
+
function Se() {
|
|
278
|
+
return ae || (ae = 1, process.env.NODE_ENV === "production" ? j.exports = be() : j.exports = ve()), j.exports;
|
|
281
279
|
}
|
|
282
|
-
var
|
|
283
|
-
const
|
|
284
|
-
map:
|
|
285
|
-
},
|
|
280
|
+
var xe = Se();
|
|
281
|
+
const Oe = "_map_1tyvt_2", pe = {
|
|
282
|
+
map: Oe
|
|
283
|
+
}, ye = {
|
|
286
284
|
// use the radius of the Normal sphere
|
|
287
285
|
radians: 6370997 / (2 * Math.PI),
|
|
288
286
|
degrees: 2 * Math.PI * 6370997 / 360,
|
|
@@ -290,7 +288,7 @@ const Ae = "_map_1tyvt_2", ye = {
|
|
|
290
288
|
m: 1,
|
|
291
289
|
"us-ft": 1200 / 3937
|
|
292
290
|
};
|
|
293
|
-
class
|
|
291
|
+
class ue {
|
|
294
292
|
/**
|
|
295
293
|
* @param {Options} options Projection options.
|
|
296
294
|
*/
|
|
@@ -336,7 +334,7 @@ class fe {
|
|
|
336
334
|
* @api
|
|
337
335
|
*/
|
|
338
336
|
getMetersPerUnit() {
|
|
339
|
-
return this.metersPerUnit_ ||
|
|
337
|
+
return this.metersPerUnit_ || ye[this.units_];
|
|
340
338
|
}
|
|
341
339
|
/**
|
|
342
340
|
* Get the world extent for this projection.
|
|
@@ -423,8 +421,8 @@ class fe {
|
|
|
423
421
|
return this.getPointResolutionFunc_;
|
|
424
422
|
}
|
|
425
423
|
}
|
|
426
|
-
const
|
|
427
|
-
class
|
|
424
|
+
const x = 6378137, w = Math.PI * x, Ae = [-w, -w, w, w], ke = [-180, -85, 180, 85], I = x * Math.log(Math.tan(Math.PI / 2));
|
|
425
|
+
class R extends ue {
|
|
428
426
|
/**
|
|
429
427
|
* @param {string} code Code.
|
|
430
428
|
*/
|
|
@@ -432,42 +430,42 @@ class w extends fe {
|
|
|
432
430
|
super({
|
|
433
431
|
code: t,
|
|
434
432
|
units: "m",
|
|
435
|
-
extent:
|
|
433
|
+
extent: Ae,
|
|
436
434
|
global: !0,
|
|
437
|
-
worldExtent:
|
|
435
|
+
worldExtent: ke,
|
|
438
436
|
getPointResolution: function(n, s) {
|
|
439
|
-
return n / Math.cosh(s[1] /
|
|
437
|
+
return n / Math.cosh(s[1] / x);
|
|
440
438
|
}
|
|
441
439
|
});
|
|
442
440
|
}
|
|
443
441
|
}
|
|
444
|
-
const
|
|
445
|
-
new
|
|
446
|
-
new
|
|
447
|
-
new
|
|
448
|
-
new
|
|
449
|
-
new
|
|
450
|
-
new
|
|
442
|
+
const oe = [
|
|
443
|
+
new R("EPSG:3857"),
|
|
444
|
+
new R("EPSG:102100"),
|
|
445
|
+
new R("EPSG:102113"),
|
|
446
|
+
new R("EPSG:900913"),
|
|
447
|
+
new R("http://www.opengis.net/def/crs/EPSG/0/3857"),
|
|
448
|
+
new R("http://www.opengis.net/gml/srs/epsg.xml#3857")
|
|
451
449
|
];
|
|
452
|
-
function
|
|
450
|
+
function Ce(r, t, n) {
|
|
453
451
|
const s = r.length;
|
|
454
452
|
n = n > 1 ? n : 2, t === void 0 && (n > 2 ? t = r.slice() : t = new Array(s));
|
|
455
|
-
for (let
|
|
456
|
-
t[
|
|
457
|
-
let
|
|
458
|
-
|
|
453
|
+
for (let o = 0; o < s; o += n) {
|
|
454
|
+
t[o] = w * r[o] / 180;
|
|
455
|
+
let l = x * Math.log(Math.tan(Math.PI * (+r[o + 1] + 90) / 360));
|
|
456
|
+
l > I ? l = I : l < -I && (l = -I), t[o + 1] = l;
|
|
459
457
|
}
|
|
460
458
|
return t;
|
|
461
459
|
}
|
|
462
|
-
function
|
|
460
|
+
function Ne(r, t, n) {
|
|
463
461
|
const s = r.length;
|
|
464
462
|
n = n > 1 ? n : 2, t === void 0 && (n > 2 ? t = r.slice() : t = new Array(s));
|
|
465
|
-
for (let
|
|
466
|
-
t[
|
|
463
|
+
for (let o = 0; o < s; o += n)
|
|
464
|
+
t[o] = 180 * r[o] / w, t[o + 1] = 360 * Math.atan(Math.exp(r[o + 1] / x)) / Math.PI - 90;
|
|
467
465
|
return t;
|
|
468
466
|
}
|
|
469
|
-
const
|
|
470
|
-
class
|
|
467
|
+
const je = 6378137, se = [-180, -90, 180, 90], Ie = Math.PI * je / 180;
|
|
468
|
+
class g extends ue {
|
|
471
469
|
/**
|
|
472
470
|
* @param {string} code Code.
|
|
473
471
|
* @param {string} [axisOrientation] Axis orientation.
|
|
@@ -476,40 +474,40 @@ class P extends fe {
|
|
|
476
474
|
super({
|
|
477
475
|
code: t,
|
|
478
476
|
units: "degrees",
|
|
479
|
-
extent:
|
|
477
|
+
extent: se,
|
|
480
478
|
axisOrientation: n,
|
|
481
479
|
global: !0,
|
|
482
|
-
metersPerUnit:
|
|
483
|
-
worldExtent:
|
|
480
|
+
metersPerUnit: Ie,
|
|
481
|
+
worldExtent: se
|
|
484
482
|
});
|
|
485
483
|
}
|
|
486
484
|
}
|
|
487
485
|
const le = [
|
|
488
|
-
new
|
|
489
|
-
new
|
|
490
|
-
new
|
|
491
|
-
new
|
|
492
|
-
new
|
|
493
|
-
new
|
|
494
|
-
new
|
|
486
|
+
new g("CRS:84"),
|
|
487
|
+
new g("EPSG:4326", "neu"),
|
|
488
|
+
new g("urn:ogc:def:crs:OGC:1.3:CRS84"),
|
|
489
|
+
new g("urn:ogc:def:crs:OGC:2:84"),
|
|
490
|
+
new g("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),
|
|
491
|
+
new g("http://www.opengis.net/gml/srs/epsg.xml#4326", "neu"),
|
|
492
|
+
new g("http://www.opengis.net/def/crs/EPSG/0/4326", "neu")
|
|
495
493
|
];
|
|
496
|
-
let
|
|
497
|
-
function
|
|
498
|
-
return
|
|
494
|
+
let V = {};
|
|
495
|
+
function Ge(r) {
|
|
496
|
+
return V[r] || V[r.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/, "EPSG:$3")] || null;
|
|
499
497
|
}
|
|
500
|
-
function
|
|
501
|
-
|
|
498
|
+
function Me(r, t) {
|
|
499
|
+
V[r] = t;
|
|
502
500
|
}
|
|
503
|
-
let
|
|
504
|
-
function
|
|
505
|
-
const s = r.getCode(),
|
|
506
|
-
s in
|
|
501
|
+
let T = {};
|
|
502
|
+
function G(r, t, n) {
|
|
503
|
+
const s = r.getCode(), o = t.getCode();
|
|
504
|
+
s in T || (T[s] = {}), T[s][o] = n;
|
|
507
505
|
}
|
|
508
506
|
function $e(r, t) {
|
|
509
507
|
let n;
|
|
510
|
-
return r in
|
|
508
|
+
return r in T && t in T[r] && (n = T[r][t]), n;
|
|
511
509
|
}
|
|
512
|
-
function
|
|
510
|
+
function fe(r, t) {
|
|
513
511
|
if (t !== void 0) {
|
|
514
512
|
for (let n = 0, s = r.length; n < s; ++n)
|
|
515
513
|
t[n] = r[n];
|
|
@@ -518,7 +516,7 @@ function de(r, t) {
|
|
|
518
516
|
t = r.slice();
|
|
519
517
|
return t;
|
|
520
518
|
}
|
|
521
|
-
function
|
|
519
|
+
function Fe(r, t) {
|
|
522
520
|
if (t !== void 0 && r !== t) {
|
|
523
521
|
for (let n = 0, s = r.length; n < s; ++n)
|
|
524
522
|
t[n] = r[n];
|
|
@@ -526,14 +524,14 @@ function Ye(r, t) {
|
|
|
526
524
|
}
|
|
527
525
|
return r;
|
|
528
526
|
}
|
|
529
|
-
function
|
|
530
|
-
|
|
527
|
+
function Ye(r) {
|
|
528
|
+
Me(r.getCode(), r), G(r, r, fe);
|
|
531
529
|
}
|
|
532
|
-
function
|
|
533
|
-
r.forEach(
|
|
530
|
+
function Ue(r) {
|
|
531
|
+
r.forEach(Ye);
|
|
534
532
|
}
|
|
535
|
-
function
|
|
536
|
-
return typeof r == "string" ?
|
|
533
|
+
function ie(r) {
|
|
534
|
+
return typeof r == "string" ? Ge(
|
|
537
535
|
/** @type {string} */
|
|
538
536
|
r
|
|
539
537
|
) : (
|
|
@@ -541,120 +539,120 @@ function ce(r) {
|
|
|
541
539
|
r || null
|
|
542
540
|
);
|
|
543
541
|
}
|
|
544
|
-
function
|
|
545
|
-
|
|
542
|
+
function ce(r) {
|
|
543
|
+
Ue(r), r.forEach(function(t) {
|
|
546
544
|
r.forEach(function(n) {
|
|
547
|
-
t !== n &&
|
|
545
|
+
t !== n && G(t, n, fe);
|
|
548
546
|
});
|
|
549
547
|
});
|
|
550
548
|
}
|
|
551
|
-
function
|
|
552
|
-
r.forEach(function(
|
|
553
|
-
t.forEach(function(
|
|
554
|
-
|
|
549
|
+
function De(r, t, n, s) {
|
|
550
|
+
r.forEach(function(o) {
|
|
551
|
+
t.forEach(function(l) {
|
|
552
|
+
G(o, l, n), G(l, o, s);
|
|
555
553
|
});
|
|
556
554
|
});
|
|
557
555
|
}
|
|
558
|
-
function
|
|
559
|
-
return
|
|
556
|
+
function We(r, t) {
|
|
557
|
+
return qe(
|
|
560
558
|
r,
|
|
561
559
|
"EPSG:4326",
|
|
562
560
|
"EPSG:3857"
|
|
563
561
|
);
|
|
564
562
|
}
|
|
565
|
-
function
|
|
563
|
+
function Xe(r, t) {
|
|
566
564
|
const n = r.getCode(), s = t.getCode();
|
|
567
|
-
let
|
|
568
|
-
return
|
|
565
|
+
let o = $e(n, s);
|
|
566
|
+
return o || (o = Fe), o;
|
|
569
567
|
}
|
|
570
|
-
function
|
|
571
|
-
const n =
|
|
572
|
-
return
|
|
568
|
+
function Le(r, t) {
|
|
569
|
+
const n = ie(r), s = ie(t);
|
|
570
|
+
return Xe(n, s);
|
|
573
571
|
}
|
|
574
|
-
function
|
|
575
|
-
return
|
|
572
|
+
function qe(r, t, n) {
|
|
573
|
+
return Le(t, n)(r, void 0, r.length);
|
|
576
574
|
}
|
|
577
|
-
function
|
|
578
|
-
|
|
575
|
+
function Je() {
|
|
576
|
+
ce(oe), ce(le), De(
|
|
579
577
|
le,
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
578
|
+
oe,
|
|
579
|
+
Ce,
|
|
580
|
+
Ne
|
|
583
581
|
);
|
|
584
582
|
}
|
|
585
|
-
|
|
586
|
-
const
|
|
583
|
+
Je();
|
|
584
|
+
const Be = ge(
|
|
587
585
|
({
|
|
588
586
|
options: r,
|
|
589
587
|
mapKey: t,
|
|
590
588
|
zoom: n,
|
|
591
589
|
defaultType: s,
|
|
592
|
-
scale:
|
|
593
|
-
center:
|
|
594
|
-
poi:
|
|
595
|
-
traffic:
|
|
596
|
-
onInit:
|
|
597
|
-
className:
|
|
598
|
-
style:
|
|
599
|
-
},
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
|
|
590
|
+
scale: o,
|
|
591
|
+
center: l,
|
|
592
|
+
poi: _,
|
|
593
|
+
traffic: m,
|
|
594
|
+
onInit: O,
|
|
595
|
+
className: M,
|
|
596
|
+
style: p
|
|
597
|
+
}, y) => {
|
|
598
|
+
const E = ee(null), d = ee(null), [b, $] = te(!1), [h, F] = te(null);
|
|
599
|
+
Pe(
|
|
600
|
+
y,
|
|
603
601
|
() => ({
|
|
604
602
|
get mapContainer() {
|
|
605
|
-
return
|
|
603
|
+
return E;
|
|
606
604
|
},
|
|
607
605
|
get map() {
|
|
608
|
-
return
|
|
606
|
+
return d.current;
|
|
609
607
|
},
|
|
610
608
|
get isInitiated() {
|
|
611
|
-
return
|
|
609
|
+
return b;
|
|
612
610
|
}
|
|
613
611
|
}),
|
|
614
|
-
[
|
|
612
|
+
[b, d.current]
|
|
615
613
|
);
|
|
616
|
-
const
|
|
617
|
-
var
|
|
618
|
-
if (
|
|
619
|
-
const c = (
|
|
614
|
+
const A = () => {
|
|
615
|
+
var k, C;
|
|
616
|
+
if (h) return h;
|
|
617
|
+
const c = (C = (k = E.current) == null ? void 0 : k.querySelector(".ol-viewport")) == null ? void 0 : C.querySelectorAll("div:last-child");
|
|
620
618
|
if (c)
|
|
621
|
-
return
|
|
619
|
+
return F(
|
|
622
620
|
Array.from(c)[c.length - 1]
|
|
623
|
-
),
|
|
621
|
+
), h;
|
|
622
|
+
}, Y = () => {
|
|
623
|
+
const c = A();
|
|
624
|
+
c == null || c.style.setProperty("scale", "" + o);
|
|
624
625
|
}, U = () => {
|
|
625
|
-
const c =
|
|
626
|
-
c == null || c.style.setProperty("scale", "" + a);
|
|
627
|
-
}, D = () => {
|
|
628
|
-
const c = j();
|
|
626
|
+
const c = A();
|
|
629
627
|
c == null || c.style.setProperty("bottom", "0.2em"), c == null || c.style.setProperty("left", "0.4em");
|
|
630
|
-
},
|
|
631
|
-
if (
|
|
628
|
+
}, D = () => {
|
|
629
|
+
if (d.current != null || !E.current) return;
|
|
632
630
|
const c = {};
|
|
633
|
-
|
|
634
|
-
target:
|
|
631
|
+
l != null && l.longitude && l.latitude && (c.center = We([l == null ? void 0 : l.longitude, l == null ? void 0 : l.latitude])), n && (c.zoom = n), d.current = new we({
|
|
632
|
+
target: E.current,
|
|
635
633
|
key: t || "",
|
|
636
634
|
mapType: s,
|
|
637
635
|
// poi: store.state.poiLayer,
|
|
638
|
-
poi:
|
|
636
|
+
poi: _,
|
|
639
637
|
// traffic: store.state.trafficLayer,
|
|
640
|
-
traffic:
|
|
641
|
-
view: new
|
|
638
|
+
traffic: m,
|
|
639
|
+
view: new Te(c),
|
|
642
640
|
controls: [],
|
|
643
641
|
...r
|
|
644
|
-
}),
|
|
642
|
+
}), $(!0), O && O(d.current);
|
|
645
643
|
};
|
|
646
|
-
return
|
|
647
|
-
|
|
648
|
-
}, []), /* @__PURE__ */
|
|
644
|
+
return Re(() => {
|
|
645
|
+
D(), Y(), U();
|
|
646
|
+
}, []), /* @__PURE__ */ xe.jsx(
|
|
649
647
|
"div",
|
|
650
648
|
{
|
|
651
|
-
ref:
|
|
652
|
-
className:
|
|
653
|
-
style:
|
|
649
|
+
ref: E,
|
|
650
|
+
className: M || pe.map,
|
|
651
|
+
style: p
|
|
654
652
|
}
|
|
655
653
|
);
|
|
656
654
|
}
|
|
657
655
|
);
|
|
658
656
|
export {
|
|
659
|
-
|
|
657
|
+
Be as default
|
|
660
658
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(d,
|
|
1
|
+
(function(d,P){typeof exports=="object"&&typeof module<"u"?module.exports=P(require("react"),require("@neshan-maps-platform/ol")):typeof define=="function"&&define.amd?define(["react","@neshan-maps-platform/ol"],P):(d=typeof globalThis<"u"?globalThis:d||self,d["neshan-ol-react-sdk"]=P(d.require$$0,d.ol))})(this,function(d,P){"use strict";var y={exports:{}},S={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var H;function de(){if(H)return S;H=1;var r=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,o,l){var h=null;if(l!==void 0&&(h=""+l),o.key!==void 0&&(h=""+o.key),"key"in o){l={};for(var g in o)g!=="key"&&(l[g]=o[g])}else l=o;return o=l.ref,{$$typeof:r,type:s,key:h,ref:o!==void 0?o:null,props:l}}return S.Fragment=t,S.jsx=n,S.jsxs=n,S}var x={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var Z;function Ee(){return Z||(Z=1,process.env.NODE_ENV!=="production"&&function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Fe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case I:return"Profiler";case W:return"StrictMode";case c:return"Suspense";case G:return"SuspenseList";case Me:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case D:return"Portal";case L:return e.displayName||"Context";case X:return(e._context.displayName||"Context")+".Consumer";case $:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case M:return a=e.displayName||null,a!==null?a:r(e.type)||"Memo";case J:a=e._payload,e=e._init;try{return r(e(a))}catch{}}return null}function t(e){return""+e}function n(e){try{t(e);var a=!1}catch{a=!0}if(a){a=console;var i=a.error,u=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),t(e)}}function s(e){if(e===R)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===J)return"<...>";try{var a=r(e);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function o(){var e=V.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function h(e){if(se.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function g(e,a){function i(){le||(le=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}function N(){var e=r(this.type);return ie[e]||(ie[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function U(e,a,i,u,F,z){var f=i.ref;return e={$$typeof:O,type:e,key:a,props:i,_owner:u},(f!==void 0?f:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:N}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:F}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:z}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function C(e,a,i,u,F,z){var f=a.children;if(f!==void 0)if(u)if(Ye(f)){for(u=0;u<f.length;u++)j(f[u]);Object.freeze&&Object.freeze(f)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else j(f);if(se.call(a,"key")){f=r(e);var v=Object.keys(a).filter(function(Ue){return Ue!=="key"});u=0<v.length?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}",fe[f+u]||(v=0<v.length?"{"+v.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,u,f,v,f),
|
|
22
|
+
<%s key={someKey} {...props} />`,u,f,v,f),fe[f+u]=!0)}if(f=null,i!==void 0&&(n(i),f=""+i),h(a)&&(n(a.key),f=""+a.key),"key"in a){i={};for(var B in a)B!=="key"&&(i[B]=a[B])}else i=a;return f&&g(i,typeof e=="function"?e.displayName||e.name||"Unknown":e),U(e,f,i,o(),F,z)}function j(e){m(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===J&&(e._payload.status==="fulfilled"?m(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function m(e){return typeof e=="object"&&e!==null&&e.$$typeof===O}var E=d,O=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),L=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),Me=Symbol.for("react.activity"),Fe=Symbol.for("react.client.reference"),V=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=Object.prototype.hasOwnProperty,Ye=Array.isArray,q=console.createTask?console.createTask:function(){return null};E={react_stack_bottom_frame:function(e){return e()}};var le,ie={},ce=E.react_stack_bottom_frame.bind(E,l)(),ue=q(s(l)),fe={};x.Fragment=R,x.jsx=function(e,a,i){var u=1e4>V.recentlyCreatedOwnerStacks++;return C(e,a,i,!1,u?Error("react-stack-top-frame"):ce,u?q(s(e)):ue)},x.jsxs=function(e,a,i){var u=1e4>V.recentlyCreatedOwnerStacks++;return C(e,a,i,!0,u?Error("react-stack-top-frame"):ce,u?q(s(e)):ue)}}()),x}var Q;function me(){return Q||(Q=1,process.env.NODE_ENV==="production"?y.exports=de():y.exports=Ee()),y.exports}var _e=me();const he={map:"_map_1tyvt_2"},ge={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class K{constructor(t){this.code_=t.code,this.units_=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}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||ge[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const p=6378137,T=Math.PI*p,Re=[-T,-T,T,T],Pe=[-180,-85,180,85],A=p*Math.log(Math.tan(Math.PI/2));class w extends K{constructor(t){super({code:t,units:"m",extent:Re,global:!0,worldExtent:Pe,getPointResolution:function(n,s){return n/Math.cosh(s[1]/p)}})}}const ee=[new w("EPSG:3857"),new w("EPSG:102100"),new w("EPSG:102113"),new w("EPSG:900913"),new w("http://www.opengis.net/def/crs/EPSG/0/3857"),new w("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Te(r,t,n){const s=r.length;n=n>1?n:2,t===void 0&&(n>2?t=r.slice():t=new Array(s));for(let o=0;o<s;o+=n){t[o]=T*r[o]/180;let l=p*Math.log(Math.tan(Math.PI*(+r[o+1]+90)/360));l>A?l=A:l<-A&&(l=-A),t[o+1]=l}return t}function we(r,t,n){const s=r.length;n=n>1?n:2,t===void 0&&(n>2?t=r.slice():t=new Array(s));for(let o=0;o<s;o+=n)t[o]=180*r[o]/T,t[o+1]=360*Math.atan(Math.exp(r[o+1]/p))/Math.PI-90;return t}const be=6378137,te=[-180,-90,180,90],ve=Math.PI*be/180;class _ extends K{constructor(t,n){super({code:t,units:"degrees",extent:te,axisOrientation:n,global:!0,metersPerUnit:ve,worldExtent:te})}}const re=[new _("CRS:84"),new _("EPSG:4326","neu"),new _("urn:ogc:def:crs:OGC:1.3:CRS84"),new _("urn:ogc:def:crs:OGC:2:84"),new _("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new _("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new _("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Y={};function Se(r){return Y[r]||Y[r.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function xe(r,t){Y[r]=t}let b={};function k(r,t,n){const s=r.getCode(),o=t.getCode();s in b||(b[s]={}),b[s][o]=n}function pe(r,t){let n;return r in b&&t in b[r]&&(n=b[r][t]),n}function ne(r,t){if(t!==void 0){for(let n=0,s=r.length;n<s;++n)t[n]=r[n];t=t}else t=r.slice();return t}function Oe(r,t){if(t!==void 0&&r!==t){for(let n=0,s=r.length;n<s;++n)t[n]=r[n];r=t}return r}function ye(r){xe(r.getCode(),r),k(r,r,ne)}function Ae(r){r.forEach(ye)}function ae(r){return typeof r=="string"?Se(r):r||null}function oe(r){Ae(r),r.forEach(function(t){r.forEach(function(n){t!==n&&k(t,n,ne)})})}function ke(r,t,n,s){r.forEach(function(o){t.forEach(function(l){k(o,l,n),k(l,o,s)})})}function Ne(r,t){return Ie(r,"EPSG:4326","EPSG:3857")}function Ce(r,t){const n=r.getCode(),s=t.getCode();let o=pe(n,s);return o||(o=Oe),o}function je(r,t){const n=ae(r),s=ae(t);return Ce(n,s)}function Ie(r,t,n){return je(t,n)(r,void 0,r.length)}function Ge(){oe(ee),oe(re),ke(re,ee,Te,we)}return Ge(),d.forwardRef(({options:r,mapKey:t,zoom:n,defaultType:s,scale:o,center:l,poi:h,traffic:g,onInit:N,className:U,style:C},j)=>{const m=d.useRef(null),E=d.useRef(null),[O,D]=d.useState(!1),[R,W]=d.useState(null);d.useImperativeHandle(j,()=>({get mapContainer(){return m},get map(){return E.current},get isInitiated(){return O}}),[O,E.current]);const I=()=>{var G,M;if(R)return R;const c=(M=(G=m.current)==null?void 0:G.querySelector(".ol-viewport"))==null?void 0:M.querySelectorAll("div:last-child");if(c)return W(Array.from(c)[c.length-1]),R},X=()=>{const c=I();c==null||c.style.setProperty("scale",""+o)},L=()=>{const c=I();c==null||c.style.setProperty("bottom","0.2em"),c==null||c.style.setProperty("left","0.4em")},$=()=>{if(E.current!=null||!m.current)return;const c={};l!=null&&l.longitude&&l.latitude&&(c.center=Ne([l==null?void 0:l.longitude,l==null?void 0:l.latitude])),n&&(c.zoom=n),E.current=new P.Map({target:m.current,key:t||"",mapType:s,poi:h,traffic:g,view:new P.View(c),controls:[],...r}),D(!0),N&&N(E.current)};return d.useEffect(()=>{$(),X(),L()},[]),_e.jsx("div",{ref:m,className:U||he.map,style:C})})});
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"title": "react-neshanmap-openlayers",
|
|
4
4
|
"description": "A react map component wrapping neshan openlayers map.",
|
|
5
5
|
"private": false,
|
|
6
|
-
"version": "3.0.
|
|
6
|
+
"version": "3.0.3-alpha.1",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"types": "./dist/types/components/index.d.ts",
|
|
9
9
|
"files": [
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@neshan-maps-platform/ol": "1.0.5",
|
|
22
|
-
"react": "19.1
|
|
23
|
-
"react-dom": "19.1
|
|
22
|
+
"react": "^19.2.1",
|
|
23
|
+
"react-dom": "^19.2.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^22.14.1",
|