@neshan-maps-platform/react-openlayers 2.0.14 → 2.0.16
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 +220 -214
- package/dist/React-Openlayers.js +52 -51
- package/dist/React-Openlayers.umd.cjs +8 -8
- package/dist/types/App.d.ts +3 -3
- package/dist/types/App.model.d.ts +3 -3
- package/dist/types/assets/ol.model.d.ts +130 -131
- package/dist/types/components/Map.d.ts +5 -5
- package/dist/types/components/Map.model.d.ts +55 -55
- package/dist/types/components/index.d.ts +4 -3
- package/dist/types/main.d.ts +1 -1
- package/dist/types/parameters/index.d.ts +47 -47
- package/dist/types/store/ContextProvider.d.ts +3 -3
- package/dist/types/store/ContextProvider.model.d.ts +11 -11
- package/dist/types/store/context.d.ts +11 -11
- package/dist/types/utils/features.util.d.ts +2 -2
- package/dist/types/utils/index.d.ts +7 -7
- package/dist/types/utils/location.util.d.ts +30 -30
- package/package.json +48 -48
package/dist/React-Openlayers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Le, { createContext as pr, useReducer as vr, forwardRef as Ne, useContext as mr, useRef as yr, useState as ce, useImperativeHandle as hr, useEffect as gr } from "react";
|
|
2
2
|
var le = {}, _r = {
|
|
3
3
|
get exports() {
|
|
4
4
|
return le;
|
|
@@ -6,7 +6,7 @@ var le = {}, _r = {
|
|
|
6
6
|
set exports(s) {
|
|
7
7
|
le = s;
|
|
8
8
|
}
|
|
9
|
-
},
|
|
9
|
+
}, N = {};
|
|
10
10
|
/**
|
|
11
11
|
* @license React
|
|
12
12
|
* react-jsx-runtime.production.min.js
|
|
@@ -19,20 +19,20 @@ var le = {}, _r = {
|
|
|
19
19
|
var Fe;
|
|
20
20
|
function Er() {
|
|
21
21
|
if (Fe)
|
|
22
|
-
return
|
|
22
|
+
return N;
|
|
23
23
|
Fe = 1;
|
|
24
|
-
var s =
|
|
25
|
-
function A(
|
|
24
|
+
var s = Le, f = Symbol.for("react.element"), P = Symbol.for("react.fragment"), b = Object.prototype.hasOwnProperty, v = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, F = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
25
|
+
function A(O, m, x) {
|
|
26
26
|
var _, T = {}, j = null, C = null;
|
|
27
|
-
|
|
27
|
+
x !== void 0 && (j = "" + x), m.key !== void 0 && (j = "" + m.key), m.ref !== void 0 && (C = m.ref);
|
|
28
28
|
for (_ in m)
|
|
29
29
|
b.call(m, _) && !F.hasOwnProperty(_) && (T[_] = m[_]);
|
|
30
|
-
if (
|
|
31
|
-
for (_ in m =
|
|
30
|
+
if (O && O.defaultProps)
|
|
31
|
+
for (_ in m = O.defaultProps, m)
|
|
32
32
|
T[_] === void 0 && (T[_] = m[_]);
|
|
33
|
-
return { $$typeof: f, type:
|
|
33
|
+
return { $$typeof: f, type: O, key: j, ref: C, props: T, _owner: v.current };
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return N.Fragment = P, N.jsx = A, N.jsxs = A, N;
|
|
36
36
|
}
|
|
37
37
|
var W = {};
|
|
38
38
|
/**
|
|
@@ -44,10 +44,10 @@ var W = {};
|
|
|
44
44
|
* This source code is licensed under the MIT license found in the
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
|
-
var
|
|
47
|
+
var Ie;
|
|
48
48
|
function br() {
|
|
49
|
-
return
|
|
50
|
-
var s =
|
|
49
|
+
return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
|
+
var s = Le, f = Symbol.for("react.element"), P = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), F = Symbol.for("react.profiler"), A = Symbol.for("react.provider"), O = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), S = Symbol.iterator, Y = "@@iterator";
|
|
51
51
|
function H(e) {
|
|
52
52
|
if (e === null || typeof e != "object")
|
|
53
53
|
return null;
|
|
@@ -75,7 +75,7 @@ function br() {
|
|
|
75
75
|
var X = !1, $ = !1, Z = !1, Q = !1, ee = !1, V;
|
|
76
76
|
V = Symbol.for("react.module.reference");
|
|
77
77
|
function B(e) {
|
|
78
|
-
return !!(typeof e == "string" || typeof e == "function" || e === b || e === F || ee || e === v || e ===
|
|
78
|
+
return !!(typeof e == "string" || typeof e == "function" || e === b || e === F || ee || e === v || e === x || e === _ || Q || e === C || X || $ || Z || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === T || e.$$typeof === A || e.$$typeof === O || e.$$typeof === m || // This needs to include all possible module reference object
|
|
79
79
|
// types supported by any Flight configuration anywhere since
|
|
80
80
|
// we don't know which Flight build this will end up being used
|
|
81
81
|
// with.
|
|
@@ -107,14 +107,14 @@ function br() {
|
|
|
107
107
|
return "Profiler";
|
|
108
108
|
case v:
|
|
109
109
|
return "StrictMode";
|
|
110
|
-
case
|
|
110
|
+
case x:
|
|
111
111
|
return "Suspense";
|
|
112
112
|
case _:
|
|
113
113
|
return "SuspenseList";
|
|
114
114
|
}
|
|
115
115
|
if (typeof e == "object")
|
|
116
116
|
switch (e.$$typeof) {
|
|
117
|
-
case
|
|
117
|
+
case O:
|
|
118
118
|
var r = e;
|
|
119
119
|
return g(r) + ".Consumer";
|
|
120
120
|
case A:
|
|
@@ -285,7 +285,7 @@ function br() {
|
|
|
285
285
|
} finally {
|
|
286
286
|
ne = !1, re.current = c, Be(), Error.prepareStackTrace = i;
|
|
287
287
|
}
|
|
288
|
-
var
|
|
288
|
+
var M = e ? e.displayName || e.name : "", De = M ? U(M) : "";
|
|
289
289
|
return typeof e == "function" && q.set(e, De), De;
|
|
290
290
|
}
|
|
291
291
|
function qe(e, r, t) {
|
|
@@ -303,7 +303,7 @@ function br() {
|
|
|
303
303
|
if (typeof e == "string")
|
|
304
304
|
return U(e);
|
|
305
305
|
switch (e) {
|
|
306
|
-
case
|
|
306
|
+
case x:
|
|
307
307
|
return U("Suspense");
|
|
308
308
|
case _:
|
|
309
309
|
return U("SuspenseList");
|
|
@@ -375,7 +375,7 @@ function br() {
|
|
|
375
375
|
if (He(e))
|
|
376
376
|
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(e)), Te(e);
|
|
377
377
|
}
|
|
378
|
-
var
|
|
378
|
+
var L = w.ReactCurrentOwner, Xe = {
|
|
379
379
|
key: !0,
|
|
380
380
|
ref: !0,
|
|
381
381
|
__self: !0,
|
|
@@ -399,9 +399,9 @@ function br() {
|
|
|
399
399
|
return e.key !== void 0;
|
|
400
400
|
}
|
|
401
401
|
function er(e, r) {
|
|
402
|
-
if (typeof e.ref == "string" &&
|
|
403
|
-
var t = l(
|
|
404
|
-
oe[t] || (y('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', l(
|
|
402
|
+
if (typeof e.ref == "string" && L.current && r && L.current.stateNode !== r) {
|
|
403
|
+
var t = l(L.current.type);
|
|
404
|
+
oe[t] || (y('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', l(L.current.type), e.ref), oe[t] = !0);
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
function rr(e, r) {
|
|
@@ -470,11 +470,11 @@ function br() {
|
|
|
470
470
|
var p = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
471
471
|
a && rr(o, p), E && tr(o, p);
|
|
472
472
|
}
|
|
473
|
-
return nr(e, a, E, i, n,
|
|
473
|
+
return nr(e, a, E, i, n, L.current, o);
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
476
|
var ie = w.ReactCurrentOwner, we = w.ReactDebugCurrentFrame;
|
|
477
|
-
function
|
|
477
|
+
function I(e) {
|
|
478
478
|
if (e) {
|
|
479
479
|
var r = e._owner, t = z(e.type, e._source, r ? r.type : null);
|
|
480
480
|
we.setExtraStackFrame(t);
|
|
@@ -486,7 +486,7 @@ function br() {
|
|
|
486
486
|
function ue(e) {
|
|
487
487
|
return typeof e == "object" && e !== null && e.$$typeof === f;
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function Oe() {
|
|
490
490
|
{
|
|
491
491
|
if (ie.current) {
|
|
492
492
|
var e = l(ie.current.type);
|
|
@@ -509,10 +509,10 @@ Check your code at ` + r + ":" + t + ".";
|
|
|
509
509
|
return "";
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
var
|
|
512
|
+
var xe = {};
|
|
513
513
|
function ir(e) {
|
|
514
514
|
{
|
|
515
|
-
var r =
|
|
515
|
+
var r = Oe();
|
|
516
516
|
if (!r) {
|
|
517
517
|
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
518
518
|
t && (r = `
|
|
@@ -528,11 +528,11 @@ Check the top-level render call using <` + t + ">.");
|
|
|
528
528
|
return;
|
|
529
529
|
e._store.validated = !0;
|
|
530
530
|
var t = ir(r);
|
|
531
|
-
if (
|
|
531
|
+
if (xe[t])
|
|
532
532
|
return;
|
|
533
|
-
|
|
533
|
+
xe[t] = !0;
|
|
534
534
|
var n = "";
|
|
535
|
-
e && e._owner && e._owner !== ie.current && (n = " It was passed a child from " + l(e._owner.type) + "."),
|
|
535
|
+
e && e._owner && e._owner !== ie.current && (n = " It was passed a child from " + l(e._owner.type) + "."), I(e), y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), I(null);
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
538
|
function ke(e, r) {
|
|
@@ -584,11 +584,11 @@ Check the top-level render call using <` + t + ">.");
|
|
|
584
584
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
585
585
|
var n = r[t];
|
|
586
586
|
if (n !== "children" && n !== "key") {
|
|
587
|
-
|
|
587
|
+
I(e), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), I(null);
|
|
588
588
|
break;
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
|
-
e.ref !== null && (
|
|
591
|
+
e.ref !== null && (I(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), I(null));
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
594
|
function Ae(e, r, t, n, i, c) {
|
|
@@ -598,7 +598,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
598
598
|
var a = "";
|
|
599
599
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
600
600
|
var E = or(i);
|
|
601
|
-
E ? a += E : a +=
|
|
601
|
+
E ? a += E : a += Oe();
|
|
602
602
|
var d;
|
|
603
603
|
e === null ? d = "null" : ae(e) ? d = "array" : e !== void 0 && e.$$typeof === f ? (d = "<" + (l(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, a);
|
|
604
604
|
}
|
|
@@ -610,8 +610,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
610
610
|
if (R !== void 0)
|
|
611
611
|
if (n)
|
|
612
612
|
if (ae(R)) {
|
|
613
|
-
for (var
|
|
614
|
-
ke(R[
|
|
613
|
+
for (var M = 0; M < R.length; M++)
|
|
614
|
+
ke(R[M], e);
|
|
615
615
|
Object.freeze && Object.freeze(R);
|
|
616
616
|
} else
|
|
617
617
|
y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
@@ -654,16 +654,16 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
|
|
|
654
654
|
);
|
|
655
655
|
}
|
|
656
656
|
);
|
|
657
|
-
return f && We(f.coords) || Object.values(
|
|
657
|
+
return f && We(f.coords) || Object.values(Me());
|
|
658
658
|
} catch (s) {
|
|
659
659
|
console.error(s);
|
|
660
|
-
const f =
|
|
660
|
+
const f = Me();
|
|
661
661
|
return [f.longitude, f.latitude];
|
|
662
662
|
}
|
|
663
|
-
},
|
|
663
|
+
}, Me = () => ({
|
|
664
664
|
longitude: 51.36281969540723,
|
|
665
665
|
latitude: 35.69672648316882
|
|
666
|
-
}),
|
|
666
|
+
}), Or = {
|
|
667
667
|
reverse: "https://api.neshan.org/v4/reverse",
|
|
668
668
|
search: "https://api.neshan.org/v1/search",
|
|
669
669
|
map: "https://static.neshan.org/sdk/openlayers/5.3.0/ol.js"
|
|
@@ -681,7 +681,7 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
|
|
|
681
681
|
map: null,
|
|
682
682
|
mapType: "neshan",
|
|
683
683
|
mapContainer: null
|
|
684
|
-
},
|
|
684
|
+
}, xr = (s, f) => {
|
|
685
685
|
switch (f.type) {
|
|
686
686
|
case "SET_MAP":
|
|
687
687
|
return {
|
|
@@ -697,7 +697,7 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
|
|
|
697
697
|
return $e;
|
|
698
698
|
}
|
|
699
699
|
}, jr = (s) => {
|
|
700
|
-
const [f, P] = vr(
|
|
700
|
+
const [f, P] = vr(xr, $e), b = {
|
|
701
701
|
...f,
|
|
702
702
|
setMap: (v) => {
|
|
703
703
|
P({
|
|
@@ -719,7 +719,7 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
|
|
|
719
719
|
}
|
|
720
720
|
};
|
|
721
721
|
return /* @__PURE__ */ K(Ye.Provider, { value: b, children: s.children });
|
|
722
|
-
}, kr =
|
|
722
|
+
}, kr = Ne(
|
|
723
723
|
({
|
|
724
724
|
options: s,
|
|
725
725
|
mapKey: f,
|
|
@@ -728,9 +728,9 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
|
|
|
728
728
|
defaultType: v = "neshan",
|
|
729
729
|
scale: F,
|
|
730
730
|
center: A,
|
|
731
|
-
poi:
|
|
731
|
+
poi: O = !0,
|
|
732
732
|
traffic: m = !0,
|
|
733
|
-
onInit:
|
|
733
|
+
onInit: x,
|
|
734
734
|
className: _,
|
|
735
735
|
style: T
|
|
736
736
|
}, j) => {
|
|
@@ -785,19 +785,20 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
|
|
|
785
785
|
key: f || "",
|
|
786
786
|
mapType: v,
|
|
787
787
|
// poi: store.state.poiLayer,
|
|
788
|
-
poi:
|
|
788
|
+
poi: O,
|
|
789
789
|
// traffic: store.state.trafficLayer,
|
|
790
790
|
traffic: m,
|
|
791
791
|
view: new ol.View({
|
|
792
792
|
center: ol.proj.fromLonLat(g),
|
|
793
|
-
zoom: b
|
|
794
|
-
|
|
793
|
+
zoom: b
|
|
794
|
+
// Not in ol@5
|
|
795
|
+
// smoothExtentConstraint: true,
|
|
795
796
|
// projection: 'EPSG:4326' //Default was EPSG:3857
|
|
796
797
|
}),
|
|
797
798
|
controls: [],
|
|
798
799
|
...s
|
|
799
800
|
});
|
|
800
|
-
l.setMapType(v), C.setMap(l), (h = C.map) == null || h.setMapType(v), C.setMapType(v), H(!0),
|
|
801
|
+
l.setMapType(v), C.setMap(l), (h = C.map) == null || h.setMapType(v), C.setMapType(v), H(!0), x && x(ol, l);
|
|
801
802
|
}, B = () => {
|
|
802
803
|
let u, g, l;
|
|
803
804
|
return u = new Promise((h, D) => {
|
|
@@ -813,7 +814,7 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
|
|
|
813
814
|
const u = B();
|
|
814
815
|
return () => u.cancelPromise();
|
|
815
816
|
} else {
|
|
816
|
-
const u = ee(
|
|
817
|
+
const u = ee(Or.map), g = () => {
|
|
817
818
|
B();
|
|
818
819
|
};
|
|
819
820
|
return u.addEventListener("load", g), () => u.removeEventListener("load", g);
|
|
@@ -827,9 +828,9 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
|
|
|
827
828
|
}
|
|
828
829
|
);
|
|
829
830
|
}
|
|
830
|
-
), Dr =
|
|
831
|
+
), Dr = Ne(
|
|
831
832
|
(s, f) => /* @__PURE__ */ K(jr, { children: /* @__PURE__ */ K(kr, { ref: f, ...s }) })
|
|
832
833
|
);
|
|
833
834
|
export {
|
|
834
|
-
Dr as
|
|
835
|
+
Dr as default
|
|
835
836
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(D
|
|
1
|
+
(function(m,D){typeof exports=="object"&&typeof module<"u"?module.exports=D(require("react")):typeof define=="function"&&define.amd?define(["react"],D):(m=typeof globalThis<"u"?globalThis:m||self,m.ReactOpenlayers=D(m.React))})(this,function(m){"use strict";var D={},Ye={get exports(){return D},set exports(s){D=s}},W={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.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 fe;function Ve(){if(fe)return W;fe=1;var s=m,f=Symbol.for("react.element"),S=Symbol.for("react.fragment"),R=Object.prototype.hasOwnProperty,v=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,M={key:!0,ref:!0,__self:!0,__source:!0};function F(O,y,j){var E,C={},k=null,P=null;j!==void 0&&(k=""+j),y.key!==void 0&&(k=""+y.key),y.ref!==void 0&&(P=y.ref);for(E in y)R.call(y,E)&&!M.hasOwnProperty(E)&&(C[E]=y[E]);if(O&&O.defaultProps)for(E in y=O.defaultProps,y)C[E]===void 0&&(C[E]=y[E]);return{$$typeof:f,type:O,key:k,ref:P,props:C,_owner:v.current}}return W.Fragment=S,W.jsx=F,W.jsxs=F,W}var Y={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,14 +14,14 @@
|
|
|
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
|
|
18
|
-
`+
|
|
17
|
+
*/var de;function Be(){return de||(de=1,process.env.NODE_ENV!=="production"&&function(){var s=m,f=Symbol.for("react.element"),S=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),O=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),w=Symbol.iterator,U="@@iterator";function $(e){if(e===null||typeof e!="object")return null;var r=w&&e[w]||e[U];return typeof r=="function"?r:null}var x=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];he("error",e,t)}}function he(e,r,t){{var n=x.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var c=t.map(function(o){return String(o)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var q=!1,z=!1,ee=!1,re=!1,te=!1,J;J=Symbol.for("react.module.reference");function G(e){return!!(typeof e=="string"||typeof e=="function"||e===R||e===M||te||e===v||e===j||e===E||re||e===P||q||z||ee||typeof e=="object"&&e!==null&&(e.$$typeof===k||e.$$typeof===C||e.$$typeof===F||e.$$typeof===O||e.$$typeof===y||e.$$typeof===J||e.getModuleId!==void 0))}function u(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function g(e){return e.displayName||"Context"}function l(e){if(e==null)return null;if(typeof e.tag=="number"&&h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case S:return"Portal";case M:return"Profiler";case v:return"StrictMode";case j:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case O:var r=e;return g(r)+".Consumer";case F:var t=e;return g(t._context)+".Provider";case y:return u(e,e.render,"ForwardRef");case C:var n=e.displayName||null;return n!==null?n:l(e.type)||"Memo";case k:{var i=e,c=i._payload,o=i._init;try{return l(o(c))}catch{return null}}}return null}var _=Object.assign,I=0,_e,ge,Ee,be,Re,Te,Ce;function Pe(){}Pe.__reactDisabledLog=!0;function Xe(){{if(I===0){_e=console.log,ge=console.info,Ee=console.warn,be=console.error,Re=console.group,Te=console.groupCollapsed,Ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Pe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}I++}}function Ze(){{if(I--,I===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:_({},e,{value:_e}),info:_({},e,{value:ge}),warn:_({},e,{value:Ee}),error:_({},e,{value:be}),group:_({},e,{value:Re}),groupCollapsed:_({},e,{value:Te}),groupEnd:_({},e,{value:Ce})})}I<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ne=x.ReactCurrentDispatcher,ae;function K(e,r,t){{if(ae===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);ae=n&&n[1]||""}return`
|
|
18
|
+
`+ae+e}}var oe=!1,H;{var Qe=typeof WeakMap=="function"?WeakMap:Map;H=new Qe}function Se(e,r){if(!e||oe)return"";{var t=H.get(e);if(t!==void 0)return t}var n;oe=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=ne.current,ne.current=null,Xe();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(A){n=A}Reflect.construct(e,[],o)}else{try{o.call()}catch(A){n=A}e.call(o.prototype)}}else{try{throw Error()}catch(A){n=A}e()}}catch(A){if(A&&n&&typeof A.stack=="string"){for(var a=A.stack.split(`
|
|
19
19
|
`),b=n.stack.split(`
|
|
20
20
|
`),d=a.length-1,p=b.length-1;d>=1&&p>=0&&a[d]!==b[p];)p--;for(;d>=1&&p>=0;d--,p--)if(a[d]!==b[p]){if(d!==1||p!==1)do if(d--,p--,p<0||a[d]!==b[p]){var T=`
|
|
21
|
-
`+a[d].replace(" at new "," at ");return e.displayName&&T.includes("<anonymous>")&&(T=T.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,T),T}while(d>=1&&p>=0);break}}}finally{
|
|
21
|
+
`+a[d].replace(" at new "," at ");return e.displayName&&T.includes("<anonymous>")&&(T=T.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,T),T}while(d>=1&&p>=0);break}}}finally{oe=!1,ne.current=c,Ze(),Error.prepareStackTrace=i}var L=e?e.displayName||e.name:"",We=L?K(L):"";return typeof e=="function"&&H.set(e,We),We}function $e(e,r,t){return Se(e,!1)}function qe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function X(e,r,t){if(e==null)return"";if(typeof e=="function")return Se(e,qe(e));if(typeof e=="string")return K(e);switch(e){case j:return K("Suspense");case E:return K("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case y:return $e(e.render);case C:return X(e.type,r,t);case k:{var n=e,i=n._payload,c=n._init;try{return X(c(i),r,t)}catch{}}}return""}var Z=Object.prototype.hasOwnProperty,we={},xe=x.ReactDebugCurrentFrame;function Q(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(t)}else xe.setExtraStackFrame(null)}function er(e,r,t,n,i){{var c=Function.call.bind(Z);for(var o in e)if(c(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var b=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw b.name="Invariant Violation",b}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(d){a=d}a&&!(a instanceof Error)&&(Q(i),h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),Q(null)),a instanceof Error&&!(a.message in we)&&(we[a.message]=!0,Q(i),h("Failed %s type: %s",t,a.message),Q(null))}}}var rr=Array.isArray;function ie(e){return rr(e)}function tr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function nr(e){try{return Oe(e),!1}catch{return!0}}function Oe(e){return""+e}function je(e){if(nr(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",tr(e)),Oe(e)}var V=x.ReactCurrentOwner,ar={key:!0,ref:!0,__self:!0,__source:!0},ke,Ae,se;se={};function or(e){if(Z.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function ir(e){if(Z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function sr(e,r){if(typeof e.ref=="string"&&V.current&&r&&V.current.stateNode!==r){var t=l(V.current.type);se[t]||(h('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',l(V.current.type),e.ref),se[t]=!0)}}function ur(e,r){{var t=function(){ke||(ke=!0,h("%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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function cr(e,r){{var t=function(){Ae||(Ae=!0,h("%s: `ref` 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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var lr=function(e,r,t,n,i,c,o){var a={$$typeof:f,type:e,key:r,ref:t,props:o,_owner:c};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function fr(e,r,t,n,i){{var c,o={},a=null,b=null;t!==void 0&&(je(t),a=""+t),ir(r)&&(je(r.key),a=""+r.key),or(r)&&(b=r.ref,sr(r,i));for(c in r)Z.call(r,c)&&!ar.hasOwnProperty(c)&&(o[c]=r[c]);if(e&&e.defaultProps){var d=e.defaultProps;for(c in d)o[c]===void 0&&(o[c]=d[c])}if(a||b){var p=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ur(o,p),b&&cr(o,p)}return lr(e,a,b,i,n,V.current,o)}}var ue=x.ReactCurrentOwner,De=x.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);De.setExtraStackFrame(t)}else De.setExtraStackFrame(null)}var ce;ce=!1;function le(e){return typeof e=="object"&&e!==null&&e.$$typeof===f}function Fe(){{if(ue.current){var e=l(ue.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function dr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+r+":"+t+"."}return""}}var Ie={};function
|
|
25
|
+
Check your code at `+r+":"+t+"."}return""}}var Ie={};function pr(e){{var r=Fe();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+t+">.")}return r}}function
|
|
27
|
+
Check the top-level render call using <`+t+">.")}return r}}function Me(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=pr(r);if(Ie[t])return;Ie[t]=!0;var n="";e&&e._owner&&e._owner!==ue.current&&(n=" It was passed a child from "+l(e._owner.type)+"."),N(e),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),N(null)}}function Ne(e,r){{if(typeof e!="object")return;if(ie(e))for(var t=0;t<e.length;t++){var n=e[t];le(n)&&Me(n,r)}else if(le(e))e._store&&(e._store.validated=!0);else if(e){var i=$(e);if(typeof i=="function"&&i!==e.entries)for(var c=i.call(e),o;!(o=c.next()).done;)le(o.value)&&Me(o.value,r)}}}function vr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===y||r.$$typeof===C))t=r.propTypes;else return;if(t){var n=l(r);er(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ce){ce=!0;var i=l(r);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){N(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),N(null);break}}e.ref!==null&&(N(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),N(null))}}function Le(e,r,t,n,i,c){{var o=G(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var b=dr(i);b?a+=b:a+=Fe();var d;e===null?d="null":ie(e)?d="array":e!==void 0&&e.$$typeof===f?(d="<"+(l(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):d=typeof e,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",d,a)}var p=fr(e,r,t,i,c);if(p==null)return p;if(o){var T=r.children;if(T!==void 0)if(n)if(ie(T)){for(var L=0;L<T.length;L++)Ne(T[L],e);Object.freeze&&Object.freeze(T)}else h("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 Ne(T,e)}return e===R?mr(p):vr(p),p}}function yr(e,r,t){return Le(e,r,t,!0)}function hr(e,r,t){return Le(e,r,t,!1)}var _r=hr,gr=yr;Y.Fragment=R,Y.jsx=_r,Y.jsxs=gr}()),Y}(function(s){process.env.NODE_ENV==="production"?s.exports=Ve():s.exports=Be()})(Ye);const B=D.jsx,Er="",Ue={map:"_map_1yxt5_2","map-popup-container":"_map-popup-container_1yxt5_7",touch:"_touch_1yxt5_26","mobile-layers-button":"_mobile-layers-button_1yxt5_30",floaten:"_floaten_1yxt5_45",float:"_float_1yxt5_45"},pe=s=>s?s instanceof Object?[s.longitude,s.latitude]:s:void 0,ze=async()=>{try{const f=await new Promise((S,R)=>{navigator.geolocation.getCurrentPosition(v=>{S(v)},v=>R(v))});return f&&pe(f.coords)||Object.values(ve())}catch(s){console.error(s);const f=ve();return[f.longitude,f.latitude]}},ve=()=>({longitude:51.36281969540723,latitude:35.69672648316882}),Je={reverse:"https://api.neshan.org/v4/reverse",search:"https://api.neshan.org/v1/search",map:"https://static.neshan.org/sdk/openlayers/5.3.0/ol.js"},me=m.createContext({map:null,mapType:"neshan",mapContainer:null,setMap:s=>{},setMapType:s=>{},setMapContainer:s=>{}}),ye={map:null,mapType:"neshan",mapContainer:null},Ge=(s,f)=>{switch(f.type){case"SET_MAP":return{...s,map:f.payload};case"SET_MAP_TYPE":return{...s,title:f.payload};default:return ye}},Ke=s=>{const[f,S]=m.useReducer(Ge,ye),R={...f,setMap:v=>{S({type:"SET_MAP",payload:v})},setMapType:v=>{S({type:"SET_MAP_TYPE",payload:v})},setMapContainer:v=>{S({type:"SET_MAP_CONTAINER",payload:v})}};return B(me.Provider,{value:R,children:s.children})},He=m.forwardRef(({options:s,mapKey:f,serviceKey:S="",zoom:R=12,defaultType:v="neshan",scale:M,center:F,poi:O=!0,traffic:y=!0,onInit:j,className:E,style:C},k)=>{const P=m.useContext(me),w=m.useRef(null),[U,$]=m.useState(!1),[x,h]=m.useState(null),[he,q]=m.useState();m.useImperativeHandle(k,()=>({get mapContainer(){return w},get ol(){return typeof ol<"u"?ol:void 0},get map(){return P.map},get isInitiated(){return U}}),[U,P.map]);const z=()=>{var g,l;if(x)return x;const u=(l=(g=w.current)==null?void 0:g.querySelector(".ol-viewport"))==null?void 0:l.querySelectorAll("div:last-child");if(u)return h(Array.from(u)[u.length-1]),x},ee=()=>{const u=z();u==null||u.style.setProperty("scale",""+M)},re=()=>{const u=z();u==null||u.style.setProperty("bottom","0.2em"),u==null||u.style.setProperty("left","0.4em")},te=(u,g="my-openlayer")=>{const l=document.getElementById(g);if(l)return l;const _=document.createElement("script");return _.src=u,_.id=g,document.getElementsByTagName("head")[0].appendChild(_),_},J=async()=>{var _;if(!w.current)return;const u=pe(F);q(u);const g=u||await ze(),l=new ol.Map({target:w.current,key:f||"",mapType:v,poi:O,traffic:y,view:new ol.View({center:ol.proj.fromLonLat(g),zoom:R}),controls:[],...s});l.setMapType(v),P.setMap(l),(_=P.map)==null||_.setMapType(v),P.setMapType(v),$(!0),j&&j(ol,l)},G=()=>{let u,g,l;return u=new Promise((_,I)=>{l=I,g=_,J().then(()=>{ee(),re(),g()}).catch(()=>{l()})}),{promise:u,cancelPromise:()=>l()}};return m.useEffect(()=>{if(w.current&&P.setMapContainer(w.current),typeof ol<"u"){const u=G();return()=>u.cancelPromise()}else{const u=te(Je.map),g=()=>{G()};return u.addEventListener("load",g),()=>u.removeEventListener("load",g)}},[]),B("div",{ref:w,className:E||Ue.map,style:C})});return m.forwardRef((s,f)=>B(Ke,{children:B(He,{ref:f,...s})}))});
|
package/dist/types/App.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare function App(): JSX.Element;
|
|
3
|
-
export default App;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare function App(): JSX.Element;
|
|
3
|
+
export default App;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare interface Props {
|
|
2
|
-
children: any;
|
|
3
|
-
}
|
|
1
|
+
export declare interface Props {
|
|
2
|
+
children: any;
|
|
3
|
+
}
|