@carto/ps-react-maps 0.0.1-beta.2 → 1.1.0
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/dist/index.cjs +6 -6
- package/dist/index.js +79 -79
- package/dist/types/map-provider/map-provider.const.d.ts +9 -0
- package/dist/types/map-provider/map-provider.hook.d.ts +20 -0
- package/dist/types/map-provider/map-provider.provider.d.ts +14 -0
- package/dist/types/map-provider/map-provider.reducer.d.ts +6 -0
- package/dist/types/map-provider/map-provider.types.d.ts +48 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react");var ke=(a=>(a.Roadmap="roadmap",a.Satellite="satellite",a.Terrain="terrain",a))(ke||{}),Ae=(a=>(a.DarkMatter="dark-matter",a.Positron="positron",a.Voyager="voyager",a))(Ae||{});const mr={positron:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",voyager:"https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json","dark-matter":"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},z=()=>{throw new Error("You forgot to wrap your component in <MapProvider>.")},W={state:{maps:{}},actions:{setViewState:z,setBasemap:z,setResize:z,setZoom:z}},
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react");var ke=(a=>(a.Roadmap="roadmap",a.Satellite="satellite",a.Terrain="terrain",a))(ke||{}),Ae=(a=>(a.DarkMatter="dark-matter",a.Positron="positron",a.Voyager="voyager",a))(Ae||{});const mr={positron:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",voyager:"https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json","dark-matter":"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},z=()=>{throw new Error("You forgot to wrap your component in <MapProvider>.")},W={state:{maps:{}},actions:{setViewState:z,setBasemap:z,setResize:z,setZoom:z}},te=h.createContext(W.state),ne=h.createContext(W.actions);var k=(a=>(a.SetViewState="SetViewState",a.SetBasemap="SetBasemap",a.SetResize="SetResize",a.SetZoom="SetZoom",a))(k||{});function De(a,{type:S,payload:T}){return{SetViewState:()=>{const{id:u,viewState:m}=T,p={...a.maps};return p[u]={...a.maps[u],viewState:m},{...a,maps:p}},SetResize:()=>{const{id:u,width:m,height:p}=T,E={...a.maps};return E[u]={...a.maps[u],viewState:{...a.maps[u].viewState,width:m,height:p}},{...a,maps:E}},SetBasemap:()=>{const{id:u,basemap:m}=T,p={...a.maps};return p[u]={...a.maps[u],basemap:m},{...a,maps:p}},SetZoom:()=>{const{id:u,zoom:m}=T,p={...a.maps};return p[u]={...a.maps[u],viewState:{...a.maps[u].viewState,zoom:m}},{...a,maps:p}}}[S]?.()??a}function yr(){return h.useContext(te)}function gr(){return h.useContext(ne)}var re={exports:{}},V={};/**
|
|
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 Oe;function br(){if(Oe)return V;Oe=1;var a=h,S=Symbol.for("react.element"),T=Symbol.for("react.fragment"),C=Object.prototype.hasOwnProperty,u=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function p(E,y,
|
|
9
|
+
*/var Oe;function br(){if(Oe)return V;Oe=1;var a=h,S=Symbol.for("react.element"),T=Symbol.for("react.fragment"),C=Object.prototype.hasOwnProperty,u=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function p(E,y,x){var g,l={},f=null,w=null;x!==void 0&&(f=""+x),y.key!==void 0&&(f=""+y.key),y.ref!==void 0&&(w=y.ref);for(g in y)C.call(y,g)&&!m.hasOwnProperty(g)&&(l[g]=y[g]);if(E&&E.defaultProps)for(g in y=E.defaultProps,y)l[g]===void 0&&(l[g]=y[g]);return{$$typeof:S,type:E,key:f,ref:w,props:l,_owner:u.current}}return V.Fragment=T,V.jsx=p,V.jsxs=p,V}var $={};/**
|
|
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 xe;function Rr(){return xe||(xe=1,process.env.NODE_ENV!=="production"&&function(){var a=h,S=Symbol.for("react.element"),T=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),E=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),
|
|
18
|
-
`+
|
|
17
|
+
*/var xe;function Rr(){return xe||(xe=1,process.env.NODE_ENV!=="production"&&function(){var a=h,S=Symbol.for("react.element"),T=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),E=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),q=Symbol.iterator,Fe="@@iterator";function Ie(e){if(e===null||typeof e!="object")return null;var r=q&&e[q]||e[Fe];return typeof r=="function"?r:null}var A=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Me("error",e,t)}}function Me(e,r,t){{var n=A.ReactDebugCurrentFrame,s=n.getStackAddendum();s!==""&&(r+="%s",t=t.concat([s]));var c=t.map(function(i){return String(i)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var Ve=!1,$e=!1,We=!1,Ye=!1,Le=!1,ae;ae=Symbol.for("react.module.reference");function Ne(e){return!!(typeof e=="string"||typeof e=="function"||e===C||e===m||Le||e===u||e===x||e===g||Ye||e===w||Ve||$e||We||typeof e=="object"&&e!==null&&(e.$$typeof===f||e.$$typeof===l||e.$$typeof===p||e.$$typeof===E||e.$$typeof===y||e.$$typeof===ae||e.getModuleId!==void 0))}function Ue(e,r,t){var n=e.displayName;if(n)return n;var s=r.displayName||r.name||"";return s!==""?t+"("+s+")":t}function oe(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&b("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 C:return"Fragment";case T:return"Portal";case m:return"Profiler";case u:return"StrictMode";case x:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case E:var r=e;return oe(r)+".Consumer";case p:var t=e;return oe(t._context)+".Provider";case y:return Ue(e,e.render,"ForwardRef");case l:var n=e.displayName||null;return n!==null?n:P(e.type)||"Memo";case f:{var s=e,c=s._payload,i=s._init;try{return P(i(c))}catch{return null}}}return null}var j=Object.assign,I=0,ie,se,ue,ce,le,fe,de;function ve(){}ve.__reactDisabledLog=!0;function Be(){{if(I===0){ie=console.log,se=console.info,ue=console.warn,ce=console.error,le=console.group,fe=console.groupCollapsed,de=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ve,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:j({},e,{value:ie}),info:j({},e,{value:se}),warn:j({},e,{value:ue}),error:j({},e,{value:ce}),group:j({},e,{value:le}),groupCollapsed:j({},e,{value:fe}),groupEnd:j({},e,{value:de})})}I<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var J=A.ReactCurrentDispatcher,Z;function Y(e,r,t){{if(Z===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);Z=n&&n[1]||""}return`
|
|
18
|
+
`+Z+e}}var G=!1,L;{var qe=typeof WeakMap=="function"?WeakMap:Map;L=new qe}function pe(e,r){if(!e||G)return"";{var t=L.get(e);if(t!==void 0)return t}var n;G=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=J.current,J.current=null,Be();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(O){n=O}Reflect.construct(e,[],i)}else{try{i.call()}catch(O){n=O}e.call(i.prototype)}}else{try{throw Error()}catch(O){n=O}e()}}catch(O){if(O&&n&&typeof O.stack=="string"){for(var o=O.stack.split(`
|
|
19
19
|
`),R=n.stack.split(`
|
|
20
20
|
`),d=o.length-1,v=R.length-1;d>=1&&v>=0&&o[d]!==R[v];)v--;for(;d>=1&&v>=0;d--,v--)if(o[d]!==R[v]){if(d!==1||v!==1)do if(d--,v--,v<0||o[d]!==R[v]){var _=`
|
|
21
|
-
`+o[d].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&L.set(e,_),_}while(d>=1&&v>=0);break}}}finally{
|
|
21
|
+
`+o[d].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&L.set(e,_),_}while(d>=1&&v>=0);break}}}finally{G=!1,J.current=c,ze(),Error.prepareStackTrace=s}var F=e?e.displayName||e.name:"",Pe=F?Y(F):"";return typeof e=="function"&&L.set(e,Pe),Pe}function Je(e,r,t){return pe(e,!1)}function Ze(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function N(e,r,t){if(e==null)return"";if(typeof e=="function")return pe(e,Ze(e));if(typeof e=="string")return Y(e);switch(e){case x:return Y("Suspense");case g:return Y("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case y:return Je(e.render);case l:return N(e.type,r,t);case f:{var n=e,s=n._payload,c=n._init;try{return N(c(s),r,t)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,me={},ye=A.ReactDebugCurrentFrame;function B(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(t)}else ye.setExtraStackFrame(null)}function Ge(e,r,t,n,s){{var c=Function.call.bind(U);for(var i in e)if(c(e,i)){var o=void 0;try{if(typeof e[i]!="function"){var R=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw R.name="Invariant Violation",R}o=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(d){o=d}o&&!(o instanceof Error)&&(B(s),b("%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,i,typeof o),B(null)),o instanceof Error&&!(o.message in me)&&(me[o.message]=!0,B(s),b("Failed %s type: %s",t,o.message),B(null))}}}var Ke=Array.isArray;function K(e){return Ke(e)}function He(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Xe(e){try{return ge(e),!1}catch{return!0}}function ge(e){return""+e}function be(e){if(Xe(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",He(e)),ge(e)}var M=A.ReactCurrentOwner,Qe={key:!0,ref:!0,__self:!0,__source:!0},Re,he,H;H={};function er(e){if(U.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function rr(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function tr(e,r){if(typeof e.ref=="string"&&M.current&&r&&M.current.stateNode!==r){var t=P(M.current.type);H[t]||(b('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',P(M.current.type),e.ref),H[t]=!0)}}function nr(e,r){{var t=function(){Re||(Re=!0,b("%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 ar(e,r){{var t=function(){he||(he=!0,b("%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 or=function(e,r,t,n,s,c,i){var o={$$typeof:S,type:e,key:r,ref:t,props:i,_owner:c};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function ir(e,r,t,n,s){{var c,i={},o=null,R=null;t!==void 0&&(be(t),o=""+t),rr(r)&&(be(r.key),o=""+r.key),er(r)&&(R=r.ref,tr(r,s));for(c in r)U.call(r,c)&&!Qe.hasOwnProperty(c)&&(i[c]=r[c]);if(e&&e.defaultProps){var d=e.defaultProps;for(c in d)i[c]===void 0&&(i[c]=d[c])}if(o||R){var v=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&nr(i,v),R&&ar(i,v)}return or(e,o,R,s,n,M.current,i)}}var X=A.ReactCurrentOwner,Ee=A.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var Q;Q=!1;function ee(e){return typeof e=="object"&&e!==null&&e.$$typeof===S}function _e(){{if(X.current){var e=P(X.current.type);if(e)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+e+"`."}return""}}function sr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
24
|
|
|
25
25
|
Check your code at `+r+":"+t+"."}return""}}var Se={};function ur(e){{var r=_e();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 Te(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ur(r);if(Se[t])return;Se[t]=!0;var n="";e&&e._owner&&e._owner!==
|
|
27
|
+
Check the top-level render call using <`+t+">.")}return r}}function Te(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ur(r);if(Se[t])return;Se[t]=!0;var n="";e&&e._owner&&e._owner!==X.current&&(n=" It was passed a child from "+P(e._owner.type)+"."),D(e),b('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),D(null)}}function Ce(e,r){{if(typeof e!="object")return;if(K(e))for(var t=0;t<e.length;t++){var n=e[t];ee(n)&&Te(n,r)}else if(ee(e))e._store&&(e._store.validated=!0);else if(e){var s=Ie(e);if(typeof s=="function"&&s!==e.entries)for(var c=s.call(e),i;!(i=c.next()).done;)ee(i.value)&&Te(i.value,r)}}}function cr(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===l))t=r.propTypes;else return;if(t){var n=P(r);Ge(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!Q){Q=!0;var s=P(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function lr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){D(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),D(null);break}}e.ref!==null&&(D(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}function we(e,r,t,n,s,c){{var i=Ne(e);if(!i){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" 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 R=sr(s);R?o+=R:o+=_e();var d;e===null?d="null":K(e)?d="array":e!==void 0&&e.$$typeof===S?(d="<"+(P(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):d=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",d,o)}var v=ir(e,r,t,s,c);if(v==null)return v;if(i){var _=r.children;if(_!==void 0)if(n)if(K(_)){for(var F=0;F<_.length;F++)Ce(_[F],e);Object.freeze&&Object.freeze(_)}else b("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 Ce(_,e)}return e===C?lr(v):cr(v),v}}function fr(e,r,t){return we(e,r,t,!0)}function dr(e,r,t){return we(e,r,t,!1)}var vr=dr,pr=fr;$.Fragment=C,$.jsx=vr,$.jsxs=pr}()),$}process.env.NODE_ENV==="production"?re.exports=br():re.exports=Rr();var je=re.exports;function hr({children:a,maps:S,externalSync:T}){const[C,u]=h.useReducer(De,{...W.state,maps:S.reduce((l,f)=>(l[f.id]=f,l),W.state.maps)}),m=h.useCallback((l,f,w)=>{S[0].id===l&&T?.({type:f,payload:w})},[T,S]),p=h.useCallback((l,f)=>{u({type:k.SetViewState,payload:{id:l,viewState:f}}),m(l,k.SetViewState,f)},[u,m]),E=h.useCallback((l,{height:f,width:w})=>{u({type:k.SetResize,payload:{id:l,height:f,width:w}}),m(l,k.SetResize,{height:f,width:w})},[u,m]),y=h.useCallback((l,f)=>{u({type:k.SetBasemap,payload:{id:l,basemap:f}})},[u]),x=h.useCallback((l,f)=>{u({type:k.SetZoom,payload:{id:l,zoom:f}})},[u]),g=h.useRef({setViewState:p,setBasemap:y,setResize:E,setZoom:x});return je.jsx(ne.Provider,{value:g.current,children:je.jsx(te.Provider,{value:C,children:a})})}exports.CartoBasemapURL=mr;exports.CartoBasemapsNames=Ae;exports.GMapsBasemap=ke;exports.INITIAL_STATE=W;exports.MapActionsContext=ne;exports.MapContext=te;exports.MapProvider=hr;exports.reducer=De;exports.useMap=yr;exports.useMapActions=gr;
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ const Sr = {
|
|
|
23
23
|
), Fe = je(
|
|
24
24
|
B.actions
|
|
25
25
|
);
|
|
26
|
-
var
|
|
26
|
+
var j = /* @__PURE__ */ ((a) => (a.SetViewState = "SetViewState", a.SetBasemap = "SetBasemap", a.SetResize = "SetResize", a.SetZoom = "SetZoom", a))(j || {});
|
|
27
27
|
function br(a, { type: _, payload: S }) {
|
|
28
28
|
return {
|
|
29
29
|
SetViewState: () => {
|
|
@@ -81,7 +81,7 @@ function Tr() {
|
|
|
81
81
|
function wr() {
|
|
82
82
|
return ke(Fe);
|
|
83
83
|
}
|
|
84
|
-
var
|
|
84
|
+
var re = { exports: {} }, $ = {};
|
|
85
85
|
/**
|
|
86
86
|
* @license React
|
|
87
87
|
* react-jsx-runtime.production.min.js
|
|
@@ -97,15 +97,15 @@ function hr() {
|
|
|
97
97
|
return $;
|
|
98
98
|
Ce = 1;
|
|
99
99
|
var a = xe, _ = Symbol.for("react.element"), S = Symbol.for("react.fragment"), T = Object.prototype.hasOwnProperty, u = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
100
|
-
function p(h, y,
|
|
101
|
-
var g, l = {}, f = null,
|
|
102
|
-
|
|
100
|
+
function p(h, y, O) {
|
|
101
|
+
var g, l = {}, f = null, w = null;
|
|
102
|
+
O !== void 0 && (f = "" + O), y.key !== void 0 && (f = "" + y.key), y.ref !== void 0 && (w = y.ref);
|
|
103
103
|
for (g in y)
|
|
104
104
|
T.call(y, g) && !m.hasOwnProperty(g) && (l[g] = y[g]);
|
|
105
105
|
if (h && h.defaultProps)
|
|
106
106
|
for (g in y = h.defaultProps, y)
|
|
107
107
|
l[g] === void 0 && (l[g] = y[g]);
|
|
108
|
-
return { $$typeof: _, type: h, key: f, ref:
|
|
108
|
+
return { $$typeof: _, type: h, key: f, ref: w, props: l, _owner: u.current };
|
|
109
109
|
}
|
|
110
110
|
return $.Fragment = S, $.jsx = p, $.jsxs = p, $;
|
|
111
111
|
}
|
|
@@ -122,14 +122,14 @@ var W = {};
|
|
|
122
122
|
var Pe;
|
|
123
123
|
function Er() {
|
|
124
124
|
return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
125
|
-
var a = xe, _ = Symbol.for("react.element"), S = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), h = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"),
|
|
125
|
+
var a = xe, _ = Symbol.for("react.element"), S = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), h = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), l = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), q = Symbol.iterator, Ae = "@@iterator";
|
|
126
126
|
function Ie(e) {
|
|
127
127
|
if (e === null || typeof e != "object")
|
|
128
128
|
return null;
|
|
129
|
-
var r =
|
|
129
|
+
var r = q && e[q] || e[Ae];
|
|
130
130
|
return typeof r == "function" ? r : null;
|
|
131
131
|
}
|
|
132
|
-
var
|
|
132
|
+
var k = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
133
133
|
function R(e) {
|
|
134
134
|
{
|
|
135
135
|
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
@@ -139,7 +139,7 @@ function Er() {
|
|
|
139
139
|
}
|
|
140
140
|
function Ve(e, r, t) {
|
|
141
141
|
{
|
|
142
|
-
var n =
|
|
142
|
+
var n = k.ReactDebugCurrentFrame, s = n.getStackAddendum();
|
|
143
143
|
s !== "" && (r += "%s", t = t.concat([s]));
|
|
144
144
|
var c = t.map(function(i) {
|
|
145
145
|
return String(i);
|
|
@@ -150,7 +150,7 @@ function Er() {
|
|
|
150
150
|
var $e = !1, We = !1, Ye = !1, Me = !1, Le = !1, te;
|
|
151
151
|
te = Symbol.for("react.module.reference");
|
|
152
152
|
function Ne(e) {
|
|
153
|
-
return !!(typeof e == "string" || typeof e == "function" || e === T || e === m || Le || e === u || e ===
|
|
153
|
+
return !!(typeof e == "string" || typeof e == "function" || e === T || e === m || Le || e === u || e === O || e === g || Me || e === w || $e || We || Ye || typeof e == "object" && e !== null && (e.$$typeof === f || e.$$typeof === l || e.$$typeof === p || e.$$typeof === h || e.$$typeof === y || // This needs to include all possible module reference object
|
|
154
154
|
// types supported by any Flight configuration anywhere since
|
|
155
155
|
// we don't know which Flight build this will end up being used
|
|
156
156
|
// with.
|
|
@@ -166,7 +166,7 @@ function Er() {
|
|
|
166
166
|
function ne(e) {
|
|
167
167
|
return e.displayName || "Context";
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function C(e) {
|
|
170
170
|
if (e == null)
|
|
171
171
|
return null;
|
|
172
172
|
if (typeof e.tag == "number" && R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
@@ -182,7 +182,7 @@ function Er() {
|
|
|
182
182
|
return "Profiler";
|
|
183
183
|
case u:
|
|
184
184
|
return "StrictMode";
|
|
185
|
-
case
|
|
185
|
+
case O:
|
|
186
186
|
return "Suspense";
|
|
187
187
|
case g:
|
|
188
188
|
return "SuspenseList";
|
|
@@ -199,11 +199,11 @@ function Er() {
|
|
|
199
199
|
return Ue(e, e.render, "ForwardRef");
|
|
200
200
|
case l:
|
|
201
201
|
var n = e.displayName || null;
|
|
202
|
-
return n !== null ? n :
|
|
202
|
+
return n !== null ? n : C(e.type) || "Memo";
|
|
203
203
|
case f: {
|
|
204
204
|
var s = e, c = s._payload, i = s._init;
|
|
205
205
|
try {
|
|
206
|
-
return
|
|
206
|
+
return C(i(c));
|
|
207
207
|
} catch {
|
|
208
208
|
return null;
|
|
209
209
|
}
|
|
@@ -273,27 +273,27 @@ function Er() {
|
|
|
273
273
|
A < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
var
|
|
276
|
+
var J = k.ReactCurrentDispatcher, Z;
|
|
277
277
|
function Y(e, r, t) {
|
|
278
278
|
{
|
|
279
|
-
if (
|
|
279
|
+
if (Z === void 0)
|
|
280
280
|
try {
|
|
281
281
|
throw Error();
|
|
282
282
|
} catch (s) {
|
|
283
283
|
var n = s.stack.trim().match(/\n( *(at )?)/);
|
|
284
|
-
|
|
284
|
+
Z = n && n[1] || "";
|
|
285
285
|
}
|
|
286
286
|
return `
|
|
287
|
-
` +
|
|
287
|
+
` + Z + e;
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
var
|
|
290
|
+
var G = !1, M;
|
|
291
291
|
{
|
|
292
292
|
var qe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
293
293
|
M = new qe();
|
|
294
294
|
}
|
|
295
295
|
function de(e, r) {
|
|
296
|
-
if (!e ||
|
|
296
|
+
if (!e || G)
|
|
297
297
|
return "";
|
|
298
298
|
{
|
|
299
299
|
var t = M.get(e);
|
|
@@ -301,11 +301,11 @@ function Er() {
|
|
|
301
301
|
return t;
|
|
302
302
|
}
|
|
303
303
|
var n;
|
|
304
|
-
|
|
304
|
+
G = !0;
|
|
305
305
|
var s = Error.prepareStackTrace;
|
|
306
306
|
Error.prepareStackTrace = void 0;
|
|
307
307
|
var c;
|
|
308
|
-
c =
|
|
308
|
+
c = J.current, J.current = null, ze();
|
|
309
309
|
try {
|
|
310
310
|
if (r) {
|
|
311
311
|
var i = function() {
|
|
@@ -318,29 +318,29 @@ function Er() {
|
|
|
318
318
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
319
319
|
try {
|
|
320
320
|
Reflect.construct(i, []);
|
|
321
|
-
} catch (
|
|
322
|
-
n =
|
|
321
|
+
} catch (P) {
|
|
322
|
+
n = P;
|
|
323
323
|
}
|
|
324
324
|
Reflect.construct(e, [], i);
|
|
325
325
|
} else {
|
|
326
326
|
try {
|
|
327
327
|
i.call();
|
|
328
|
-
} catch (
|
|
329
|
-
n =
|
|
328
|
+
} catch (P) {
|
|
329
|
+
n = P;
|
|
330
330
|
}
|
|
331
331
|
e.call(i.prototype);
|
|
332
332
|
}
|
|
333
333
|
} else {
|
|
334
334
|
try {
|
|
335
335
|
throw Error();
|
|
336
|
-
} catch (
|
|
337
|
-
n =
|
|
336
|
+
} catch (P) {
|
|
337
|
+
n = P;
|
|
338
338
|
}
|
|
339
339
|
e();
|
|
340
340
|
}
|
|
341
|
-
} catch (
|
|
342
|
-
if (
|
|
343
|
-
for (var o =
|
|
341
|
+
} catch (P) {
|
|
342
|
+
if (P && n && typeof P.stack == "string") {
|
|
343
|
+
for (var o = P.stack.split(`
|
|
344
344
|
`), b = n.stack.split(`
|
|
345
345
|
`), d = o.length - 1, v = b.length - 1; d >= 1 && v >= 0 && o[d] !== b[v]; )
|
|
346
346
|
v--;
|
|
@@ -358,9 +358,9 @@ function Er() {
|
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
} finally {
|
|
361
|
-
|
|
361
|
+
G = !1, J.current = c, Be(), Error.prepareStackTrace = s;
|
|
362
362
|
}
|
|
363
|
-
var
|
|
363
|
+
var F = e ? e.displayName || e.name : "", we = F ? Y(F) : "";
|
|
364
364
|
return typeof e == "function" && M.set(e, we), we;
|
|
365
365
|
}
|
|
366
366
|
function Je(e, r, t) {
|
|
@@ -378,7 +378,7 @@ function Er() {
|
|
|
378
378
|
if (typeof e == "string")
|
|
379
379
|
return Y(e);
|
|
380
380
|
switch (e) {
|
|
381
|
-
case
|
|
381
|
+
case O:
|
|
382
382
|
return Y("Suspense");
|
|
383
383
|
case g:
|
|
384
384
|
return Y("SuspenseList");
|
|
@@ -399,7 +399,7 @@ function Er() {
|
|
|
399
399
|
}
|
|
400
400
|
return "";
|
|
401
401
|
}
|
|
402
|
-
var N = Object.prototype.hasOwnProperty, ve = {}, pe =
|
|
402
|
+
var N = Object.prototype.hasOwnProperty, ve = {}, pe = k.ReactDebugCurrentFrame;
|
|
403
403
|
function U(e) {
|
|
404
404
|
if (e) {
|
|
405
405
|
var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
|
|
@@ -427,7 +427,7 @@ function Er() {
|
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
429
|
var Ke = Array.isArray;
|
|
430
|
-
function
|
|
430
|
+
function K(e) {
|
|
431
431
|
return Ke(e);
|
|
432
432
|
}
|
|
433
433
|
function He(e) {
|
|
@@ -450,13 +450,13 @@ function Er() {
|
|
|
450
450
|
if (Xe(e))
|
|
451
451
|
return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", He(e)), me(e);
|
|
452
452
|
}
|
|
453
|
-
var I =
|
|
453
|
+
var I = k.ReactCurrentOwner, Qe = {
|
|
454
454
|
key: !0,
|
|
455
455
|
ref: !0,
|
|
456
456
|
__self: !0,
|
|
457
457
|
__source: !0
|
|
458
|
-
}, ge, Re,
|
|
459
|
-
|
|
458
|
+
}, ge, Re, H;
|
|
459
|
+
H = {};
|
|
460
460
|
function er(e) {
|
|
461
461
|
if (N.call(e, "ref")) {
|
|
462
462
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
@@ -475,8 +475,8 @@ function Er() {
|
|
|
475
475
|
}
|
|
476
476
|
function tr(e, r) {
|
|
477
477
|
if (typeof e.ref == "string" && I.current && r && I.current.stateNode !== r) {
|
|
478
|
-
var t =
|
|
479
|
-
|
|
478
|
+
var t = C(I.current.type);
|
|
479
|
+
H[t] || (R('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', C(I.current.type), e.ref), H[t] = !0);
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
482
|
function nr(e, r) {
|
|
@@ -548,23 +548,23 @@ function Er() {
|
|
|
548
548
|
return or(e, o, b, s, n, I.current, i);
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
var
|
|
552
|
-
function
|
|
551
|
+
var X = k.ReactCurrentOwner, be = k.ReactDebugCurrentFrame;
|
|
552
|
+
function D(e) {
|
|
553
553
|
if (e) {
|
|
554
554
|
var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
|
|
555
555
|
be.setExtraStackFrame(t);
|
|
556
556
|
} else
|
|
557
557
|
be.setExtraStackFrame(null);
|
|
558
558
|
}
|
|
559
|
-
var
|
|
560
|
-
|
|
561
|
-
function
|
|
559
|
+
var Q;
|
|
560
|
+
Q = !1;
|
|
561
|
+
function ee(e) {
|
|
562
562
|
return typeof e == "object" && e !== null && e.$$typeof === _;
|
|
563
563
|
}
|
|
564
564
|
function he() {
|
|
565
565
|
{
|
|
566
|
-
if (
|
|
567
|
-
var e =
|
|
566
|
+
if (X.current) {
|
|
567
|
+
var e = C(X.current.type);
|
|
568
568
|
if (e)
|
|
569
569
|
return `
|
|
570
570
|
|
|
@@ -607,25 +607,25 @@ Check the top-level render call using <` + t + ">.");
|
|
|
607
607
|
return;
|
|
608
608
|
Ee[t] = !0;
|
|
609
609
|
var n = "";
|
|
610
|
-
e && e._owner && e._owner !==
|
|
610
|
+
e && e._owner && e._owner !== X.current && (n = " It was passed a child from " + C(e._owner.type) + "."), D(e), R('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), D(null);
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
613
|
function Se(e, r) {
|
|
614
614
|
{
|
|
615
615
|
if (typeof e != "object")
|
|
616
616
|
return;
|
|
617
|
-
if (
|
|
617
|
+
if (K(e))
|
|
618
618
|
for (var t = 0; t < e.length; t++) {
|
|
619
619
|
var n = e[t];
|
|
620
|
-
|
|
620
|
+
ee(n) && _e(n, r);
|
|
621
621
|
}
|
|
622
|
-
else if (
|
|
622
|
+
else if (ee(e))
|
|
623
623
|
e._store && (e._store.validated = !0);
|
|
624
624
|
else if (e) {
|
|
625
625
|
var s = Ie(e);
|
|
626
626
|
if (typeof s == "function" && s !== e.entries)
|
|
627
627
|
for (var c = s.call(e), i; !(i = c.next()).done; )
|
|
628
|
-
|
|
628
|
+
ee(i.value) && _e(i.value, r);
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
631
|
}
|
|
@@ -644,11 +644,11 @@ Check the top-level render call using <` + t + ">.");
|
|
|
644
644
|
else
|
|
645
645
|
return;
|
|
646
646
|
if (t) {
|
|
647
|
-
var n =
|
|
647
|
+
var n = C(r);
|
|
648
648
|
Ge(t, e.props, "prop", n, e);
|
|
649
|
-
} else if (r.PropTypes !== void 0 && !
|
|
650
|
-
|
|
651
|
-
var s =
|
|
649
|
+
} else if (r.PropTypes !== void 0 && !Q) {
|
|
650
|
+
Q = !0;
|
|
651
|
+
var s = C(r);
|
|
652
652
|
R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
|
|
653
653
|
}
|
|
654
654
|
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
@@ -659,11 +659,11 @@ Check the top-level render call using <` + t + ">.");
|
|
|
659
659
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
660
660
|
var n = r[t];
|
|
661
661
|
if (n !== "children" && n !== "key") {
|
|
662
|
-
|
|
662
|
+
D(e), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), D(null);
|
|
663
663
|
break;
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
|
-
e.ref !== null && (
|
|
666
|
+
e.ref !== null && (D(e), R("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
669
|
function Te(e, r, t, n, s, c) {
|
|
@@ -675,7 +675,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
675
675
|
var b = sr(s);
|
|
676
676
|
b ? o += b : o += he();
|
|
677
677
|
var d;
|
|
678
|
-
e === null ? d = "null" :
|
|
678
|
+
e === null ? d = "null" : K(e) ? d = "array" : e !== void 0 && e.$$typeof === _ ? (d = "<" + (C(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, o);
|
|
679
679
|
}
|
|
680
680
|
var v = ir(e, r, t, s, c);
|
|
681
681
|
if (v == null)
|
|
@@ -684,9 +684,9 @@ Check the top-level render call using <` + t + ">.");
|
|
|
684
684
|
var E = r.children;
|
|
685
685
|
if (E !== void 0)
|
|
686
686
|
if (n)
|
|
687
|
-
if (
|
|
688
|
-
for (var
|
|
689
|
-
Se(E[
|
|
687
|
+
if (K(E)) {
|
|
688
|
+
for (var F = 0; F < E.length; F++)
|
|
689
|
+
Se(E[F], e);
|
|
690
690
|
Object.freeze && Object.freeze(E);
|
|
691
691
|
} else
|
|
692
692
|
R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
@@ -706,8 +706,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
706
706
|
W.Fragment = T, W.jsx = vr, W.jsxs = pr;
|
|
707
707
|
}()), W;
|
|
708
708
|
}
|
|
709
|
-
process.env.NODE_ENV === "production" ?
|
|
710
|
-
var Oe =
|
|
709
|
+
process.env.NODE_ENV === "production" ? re.exports = hr() : re.exports = Er();
|
|
710
|
+
var Oe = re.exports;
|
|
711
711
|
function Cr({
|
|
712
712
|
children: a,
|
|
713
713
|
maps: _,
|
|
@@ -717,40 +717,40 @@ function Cr({
|
|
|
717
717
|
...B.state,
|
|
718
718
|
maps: _.reduce((l, f) => (l[f.id] = f, l), B.state.maps)
|
|
719
719
|
}), m = V(
|
|
720
|
-
(l, f) => {
|
|
720
|
+
(l, f, w) => {
|
|
721
721
|
_[0].id === l && S?.({
|
|
722
|
-
type:
|
|
723
|
-
payload:
|
|
722
|
+
type: f,
|
|
723
|
+
payload: w
|
|
724
724
|
});
|
|
725
725
|
},
|
|
726
726
|
[S, _]
|
|
727
727
|
), p = V(
|
|
728
728
|
(l, f) => {
|
|
729
729
|
u({
|
|
730
|
-
type:
|
|
730
|
+
type: j.SetViewState,
|
|
731
731
|
payload: {
|
|
732
732
|
id: l,
|
|
733
733
|
viewState: f
|
|
734
734
|
}
|
|
735
|
-
}), m(l, f);
|
|
735
|
+
}), m(l, j.SetViewState, f);
|
|
736
736
|
},
|
|
737
737
|
[u, m]
|
|
738
738
|
), h = V(
|
|
739
|
-
(l, { height: f, width:
|
|
739
|
+
(l, { height: f, width: w }) => {
|
|
740
740
|
u({
|
|
741
|
-
type:
|
|
741
|
+
type: j.SetResize,
|
|
742
742
|
payload: {
|
|
743
743
|
id: l,
|
|
744
744
|
height: f,
|
|
745
|
-
width:
|
|
745
|
+
width: w
|
|
746
746
|
}
|
|
747
|
-
}), m(l, { height: f, width:
|
|
747
|
+
}), m(l, j.SetResize, { height: f, width: w });
|
|
748
748
|
},
|
|
749
749
|
[u, m]
|
|
750
750
|
), y = V(
|
|
751
751
|
(l, f) => {
|
|
752
752
|
u({
|
|
753
|
-
type:
|
|
753
|
+
type: j.SetBasemap,
|
|
754
754
|
payload: {
|
|
755
755
|
id: l,
|
|
756
756
|
basemap: f
|
|
@@ -758,10 +758,10 @@ function Cr({
|
|
|
758
758
|
});
|
|
759
759
|
},
|
|
760
760
|
[u]
|
|
761
|
-
),
|
|
761
|
+
), O = V(
|
|
762
762
|
(l, f) => {
|
|
763
763
|
u({
|
|
764
|
-
type:
|
|
764
|
+
type: j.SetZoom,
|
|
765
765
|
payload: {
|
|
766
766
|
id: l,
|
|
767
767
|
zoom: f
|
|
@@ -773,7 +773,7 @@ function Cr({
|
|
|
773
773
|
setViewState: p,
|
|
774
774
|
setBasemap: y,
|
|
775
775
|
setResize: h,
|
|
776
|
-
setZoom:
|
|
776
|
+
setZoom: O
|
|
777
777
|
});
|
|
778
778
|
return /* @__PURE__ */ Oe.jsx(Fe.Provider, { value: g.current, children: /* @__PURE__ */ Oe.jsx(De.Provider, { value: T, children: a }) });
|
|
779
779
|
}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum for Google Maps basemap types.
|
|
3
|
+
*/
|
|
1
4
|
export declare enum GMapsBasemap {
|
|
2
5
|
Roadmap = "roadmap",
|
|
3
6
|
Satellite = "satellite",
|
|
4
7
|
Terrain = "terrain"
|
|
5
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Enum for CARTO basemap names.
|
|
11
|
+
*/
|
|
6
12
|
export declare enum CartoBasemapsNames {
|
|
7
13
|
DarkMatter = "dark-matter",
|
|
8
14
|
Positron = "positron",
|
|
9
15
|
Voyager = "voyager"
|
|
10
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Object containing URLs for CARTO basemaps.
|
|
19
|
+
*/
|
|
11
20
|
export declare const CartoBasemapURL: {
|
|
12
21
|
positron: string;
|
|
13
22
|
voyager: string;
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the current map state from the MapContext.
|
|
3
|
+
* @returns {MapContextInterface['state']} The current map state.
|
|
4
|
+
*/
|
|
1
5
|
export declare function useMap(): import("./map-provider.types").MapState;
|
|
6
|
+
/**
|
|
7
|
+
* Returns the map actions from the MapActionsContext.
|
|
8
|
+
* @returns {MapContextInterface['actions']} The map actions.
|
|
9
|
+
*/
|
|
2
10
|
export declare function useMapActions(): import("./map-provider.types").MapActionsState;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the map with the given ID from the current map state.
|
|
13
|
+
* @param {string} id - The ID of the map to retrieve.
|
|
14
|
+
* @returns {MapContextInterface['state']['maps'][string]} The map with the given ID.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useMapByID(id: string): import("./map-provider.types").MapsProps;
|
|
17
|
+
export declare function useMapActionsByID(id: string): {
|
|
18
|
+
setBasemap: (basemap: import("./map-provider.types").Basemap) => void;
|
|
19
|
+
setResize: (props: import("./map-provider.types").MapResize) => void;
|
|
20
|
+
setViewState: (viewState: import("@deck.gl/core/typed").MapViewState) => void;
|
|
21
|
+
setZoom: (zoom: number) => void;
|
|
22
|
+
};
|
|
@@ -1,2 +1,16 @@
|
|
|
1
1
|
import type { MapProviderProps } from './map-provider.types';
|
|
2
|
+
/**
|
|
3
|
+
* Provides a context for maps and their state management.
|
|
4
|
+
* @param {MapProviderProps} props - The props for the MapProvider component.
|
|
5
|
+
* @param {ReactNode} props.children - The child components to be rendered.
|
|
6
|
+
* @param {MapsProps[]} props.maps - An array of maps to be managed by the provider.
|
|
7
|
+
* @param {Function} props.externalSync - A function to sync the state with an external source.
|
|
8
|
+
* @returns {JSX.Element} - The MapProvider component.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* The MapProvider component is used to manage the state of multiple maps.
|
|
12
|
+
*
|
|
13
|
+
* The externalSync prop is used to sync the state with an external source, such as C4R. The externalSync function should accept an action object with a type and payload property.
|
|
14
|
+
* The type property should be a string that matches the action type described in the Action enum. The payload property should be an object that contains the data to be synced.
|
|
15
|
+
*/
|
|
2
16
|
export declare function MapProvider({ children, maps, externalSync, }: MapProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,5 +9,11 @@ type Action = {
|
|
|
9
9
|
type: Actions;
|
|
10
10
|
payload: MapsProps;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Reducer function for the MapProvider component.
|
|
14
|
+
* @param state - The current state of the MapProvider.
|
|
15
|
+
* @param action - The action to be performed on the state.
|
|
16
|
+
* @returns The new state of the MapProvider.
|
|
17
|
+
*/
|
|
12
18
|
export declare function reducer(state: MapState, { type, payload }: Action): MapState;
|
|
13
19
|
export {};
|
|
@@ -8,6 +8,9 @@ import type { MutableRefObject, ReactNode } from 'react';
|
|
|
8
8
|
import type { MapRef } from 'react-map-gl';
|
|
9
9
|
import { CartoBasemapsNames, GMapsBasemap } from './map-provider.const';
|
|
10
10
|
import type { Actions } from './map-provider.reducer';
|
|
11
|
+
/**
|
|
12
|
+
* Props for the MapProvider component.
|
|
13
|
+
*/
|
|
11
14
|
export type MapProviderProps = {
|
|
12
15
|
children: ReactNode;
|
|
13
16
|
maps: {
|
|
@@ -15,39 +18,77 @@ export type MapProviderProps = {
|
|
|
15
18
|
basemap: MapsProps['basemap'];
|
|
16
19
|
viewState: MapsProps['viewState'];
|
|
17
20
|
}[];
|
|
18
|
-
externalSync?:
|
|
19
|
-
type: Actions;
|
|
20
|
-
payload: any;
|
|
21
|
-
}) => void;
|
|
21
|
+
externalSync?: ExternalSync;
|
|
22
22
|
};
|
|
23
|
+
export type ExternalSync = (data: ExternalSyncProps) => void;
|
|
24
|
+
export type ExternalSyncProps = {
|
|
25
|
+
type: Actions.SetViewState;
|
|
26
|
+
payload: MapsProps['viewState'];
|
|
27
|
+
} | {
|
|
28
|
+
type: Actions.SetResize;
|
|
29
|
+
payload: MapResize;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* State for the MapProvider component.
|
|
33
|
+
*/
|
|
23
34
|
export type MapState = {
|
|
24
35
|
maps: Record<MapsProps['id'], MapsProps>;
|
|
25
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Resize properties for the map.
|
|
39
|
+
*/
|
|
26
40
|
export type MapResize = {
|
|
27
41
|
width: number | string;
|
|
28
42
|
height: number | string;
|
|
29
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Actions that can be performed on the map.
|
|
46
|
+
*/
|
|
30
47
|
export type MapActionsState = {
|
|
31
48
|
setViewState: (id: MapsProps['id'], viewState: MapViewState) => void;
|
|
32
49
|
setResize: (id: MapsProps['id'], props: MapResize) => void;
|
|
33
50
|
setBasemap: (id: MapsProps['id'], basemap: Basemap) => void;
|
|
34
51
|
setZoom: (id: MapsProps['id'], zoom: number) => void;
|
|
35
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* Context interface for the MapProvider component.
|
|
55
|
+
*/
|
|
36
56
|
export type MapContextInterface = {
|
|
37
57
|
state: MapState;
|
|
38
58
|
actions: MapActionsState;
|
|
39
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Basemap types.
|
|
62
|
+
*/
|
|
40
63
|
export type Basemap = (typeof GMapsBasemap)[keyof typeof GMapsBasemap] | (typeof CartoBasemapsNames)[keyof typeof CartoBasemapsNames] | string | StyleSpecification;
|
|
64
|
+
/**
|
|
65
|
+
* Common properties for the map.
|
|
66
|
+
*/
|
|
41
67
|
export type CommonProps = {
|
|
42
68
|
id: string;
|
|
43
69
|
basemap: Basemap;
|
|
44
70
|
instanceRef?: MutableRefObject<InstanceMapRef>;
|
|
45
71
|
overlayRef?: MutableRefObject<OverlayMapRef>;
|
|
46
72
|
} & DeckGLProps;
|
|
73
|
+
/**
|
|
74
|
+
* Properties for the maps.
|
|
75
|
+
*/
|
|
47
76
|
export type MapsProps = DeckGLMapsProps & GoogleMapsProps;
|
|
77
|
+
/**
|
|
78
|
+
* Reference to the instance map.
|
|
79
|
+
*/
|
|
48
80
|
export type InstanceMapRef = GoogleMapsOverlay | DeckGLRef | null;
|
|
81
|
+
/**
|
|
82
|
+
* Reference to the overlay map.
|
|
83
|
+
*/
|
|
49
84
|
export type OverlayMapRef = google.maps.Map | MapRef | null;
|
|
85
|
+
/**
|
|
86
|
+
* Properties for the DeckGL maps.
|
|
87
|
+
*/
|
|
50
88
|
export type DeckGLMapsProps = CommonProps;
|
|
89
|
+
/**
|
|
90
|
+
* Properties for the Google Maps.
|
|
91
|
+
*/
|
|
51
92
|
export type GoogleMapsProps = {
|
|
52
93
|
apiKey?: string;
|
|
53
94
|
height?: string | undefined;
|
|
@@ -58,6 +99,9 @@ export type GoogleMapsProps = {
|
|
|
58
99
|
version?: string;
|
|
59
100
|
width?: string | undefined;
|
|
60
101
|
} & CommonProps & GoogleMapsOverlayProps;
|
|
102
|
+
/**
|
|
103
|
+
* Tooltip properties.
|
|
104
|
+
*/
|
|
61
105
|
export type Tooltip = {
|
|
62
106
|
text?: string | undefined;
|
|
63
107
|
html?: string | undefined;
|