@deck.gl/widgets 9.1.3 → 9.1.5
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/dist.dev.js +228 -30
- package/dist/index.cjs +193 -12
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/reset-view-widget.d.ts +30 -0
- package/dist/reset-view-widget.d.ts.map +1 -0
- package/dist/reset-view-widget.js +49 -0
- package/dist/reset-view-widget.js.map +1 -0
- package/dist/screenshot-widget.d.ts +33 -0
- package/dist/screenshot-widget.d.ts.map +1 -0
- package/dist/screenshot-widget.js +63 -0
- package/dist/screenshot-widget.js.map +1 -0
- package/dist/stylesheet.css +12 -0
- package/dist/widget-impl.d.ts +29 -0
- package/dist/widget-impl.d.ts.map +1 -0
- package/dist/widget-impl.js +60 -0
- package/dist/widget-impl.js.map +1 -0
- package/dist/zoom-widget.d.ts +8 -3
- package/dist/zoom-widget.d.ts.map +1 -1
- package/dist/zoom-widget.js +29 -13
- package/dist/zoom-widget.js.map +1 -1
- package/dist.min.js +1 -1
- package/package.json +2 -2
- package/src/index.ts +9 -0
- package/src/reset-view-widget.tsx +81 -0
- package/src/screenshot-widget.tsx +91 -0
- package/src/stylesheet.css +12 -0
- package/src/widget-impl.ts +88 -0
- package/src/zoom-widget.tsx +34 -15
package/dist/zoom-widget.js
CHANGED
|
@@ -3,11 +3,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
|
3
3
|
// SPDX-License-Identifier: MIT
|
|
4
4
|
// Copyright (c) vis.gl contributors
|
|
5
5
|
/* global document */
|
|
6
|
-
import { FlyToInterpolator, _deepEqual as deepEqual, _applyStyles as applyStyles, _removeStyles as removeStyles } from '@deck.gl/core';
|
|
6
|
+
import { FlyToInterpolator, LinearInterpolator, _deepEqual as deepEqual, _applyStyles as applyStyles, _removeStyles as removeStyles } from '@deck.gl/core';
|
|
7
7
|
import { render } from 'preact';
|
|
8
8
|
import { ButtonGroup, GroupedIconButton } from "./components.js";
|
|
9
9
|
export class ZoomWidget {
|
|
10
|
-
constructor(props) {
|
|
10
|
+
constructor(props = {}) {
|
|
11
11
|
this.id = 'zoom';
|
|
12
12
|
this.placement = 'top-left';
|
|
13
13
|
this.viewId = null;
|
|
@@ -16,12 +16,8 @@ export class ZoomWidget {
|
|
|
16
16
|
this.viewId = props.viewId ?? this.viewId;
|
|
17
17
|
this.placement = props.placement ?? this.placement;
|
|
18
18
|
this.props = {
|
|
19
|
-
...
|
|
20
|
-
|
|
21
|
-
transitionDuration: props.transitionDuration ?? 200,
|
|
22
|
-
zoomInLabel: props.zoomInLabel ?? 'Zoom In',
|
|
23
|
-
zoomOutLabel: props.zoomOutLabel ?? 'Zoom Out',
|
|
24
|
-
style: props.style ?? {}
|
|
19
|
+
...ZoomWidget.defaultProps,
|
|
20
|
+
...props
|
|
25
21
|
};
|
|
26
22
|
}
|
|
27
23
|
onAdd({ deck }) {
|
|
@@ -67,12 +63,14 @@ export class ZoomWidget {
|
|
|
67
63
|
const viewId = this.viewId || viewport?.id || 'default-view';
|
|
68
64
|
const nextViewState = {
|
|
69
65
|
...viewport,
|
|
70
|
-
zoom: nextZoom
|
|
71
|
-
transitionDuration: this.props.transitionDuration,
|
|
72
|
-
transitionInterpolator: new FlyToInterpolator()
|
|
66
|
+
zoom: nextZoom
|
|
73
67
|
};
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
if (this.props.transitionDuration > 0) {
|
|
69
|
+
nextViewState.transitionDuration = this.props.transitionDuration;
|
|
70
|
+
nextViewState.transitionInterpolator =
|
|
71
|
+
'latitude' in nextViewState ? new FlyToInterpolator() : new LinearInterpolator();
|
|
72
|
+
}
|
|
73
|
+
this.setViewState(viewId, nextViewState);
|
|
76
74
|
}
|
|
77
75
|
handleZoomIn() {
|
|
78
76
|
for (const viewport of Object.values(this.viewports)) {
|
|
@@ -84,6 +82,13 @@ export class ZoomWidget {
|
|
|
84
82
|
this.handleZoom(viewport, viewport.zoom - 1);
|
|
85
83
|
}
|
|
86
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* @todo - move to deck or widget manager
|
|
87
|
+
*/
|
|
88
|
+
setViewState(viewId, viewState) {
|
|
89
|
+
// @ts-ignore Using private method temporary until there's a public one
|
|
90
|
+
this.deck._onViewStateChange({ viewId, viewState, interactionState: {} });
|
|
91
|
+
}
|
|
87
92
|
update() {
|
|
88
93
|
const element = this.element;
|
|
89
94
|
if (!element) {
|
|
@@ -93,4 +98,15 @@ export class ZoomWidget {
|
|
|
93
98
|
render(ui, element);
|
|
94
99
|
}
|
|
95
100
|
}
|
|
101
|
+
ZoomWidget.defaultProps = {
|
|
102
|
+
id: 'zoom-widget',
|
|
103
|
+
style: {},
|
|
104
|
+
placement: 'top-left',
|
|
105
|
+
className: undefined,
|
|
106
|
+
orientation: 'vertical',
|
|
107
|
+
transitionDuration: 200,
|
|
108
|
+
zoomInLabel: 'Zoom In',
|
|
109
|
+
zoomOutLabel: 'Zoom Out',
|
|
110
|
+
viewId: undefined
|
|
111
|
+
};
|
|
96
112
|
//# sourceMappingURL=zoom-widget.js.map
|
package/dist/zoom-widget.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoom-widget.js","sourceRoot":"","sources":["../src/zoom-widget.tsx"],"names":[],"mappings":";AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,qBAAqB;AACrB,OAAO,EACL,iBAAiB,EACjB,UAAU,IAAI,SAAS,EACvB,YAAY,IAAI,WAAW,EAC3B,aAAa,IAAI,YAAY,EAC9B,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAC,WAAW,EAAE,iBAAiB,EAAC,wBAAqB;AAsC5D,MAAM,OAAO,UAAU;
|
|
1
|
+
{"version":3,"file":"zoom-widget.js","sourceRoot":"","sources":["../src/zoom-widget.tsx"],"names":[],"mappings":"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"}
|
package/dist.min.js
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
5
|
else if (typeof exports === 'object') exports['deck'] = factory();
|
|
6
6
|
else root['deck'] = factory();})(globalThis, function () {
|
|
7
|
-
"use strict";var __exports__=(()=>{var Pe=Object.create;var A=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var Se=Object.getOwnPropertyNames;var Ie=Object.getPrototypeOf,We=Object.prototype.hasOwnProperty;var De=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ne=(t,e)=>{for(var n in e)A(t,n,{get:e[n],enumerable:!0})},R=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Se(e))!We.call(t,i)&&i!==n&&A(t,i,{get:()=>e[i],enumerable:!(o=Le(e,i))||o.enumerable});return t},L=(t,e,n)=>(R(t,e,"default"),n&&R(n,e,"default")),z=(t,e,n)=>(n=t!=null?Pe(Ie(t)):{},R(e||!t||!t.__esModule?A(n,"default",{value:t,enumerable:!0}):n,t)),Fe=t=>R(A({},"__esModule",{value:!0}),t);var N=De((Be,ce)=>{ce.exports=globalThis.deck});var O={};Ne(O,{CompassWidget:()=>J,DarkGlassTheme:()=>$e,DarkTheme:()=>Ae,FullscreenWidget:()=>X,LightGlassTheme:()=>je,LightTheme:()=>Re,ZoomWidget:()=>K});var x={},_e=z(N(),1);L(x,z(N(),1));if(!_e.Layer)throw new Error("@deck.gl/core is not found");L(O,x);var D=z(N(),1);var G,f,he,Ee,I,ue,me,Y,oe,ee,te,Te,V={},ge=[],Me=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ie=Array.isArray;function S(t,e){for(var n in e)t[n]=e[n];return t}function ve(t){var e=t.parentNode;e&&e.removeChild(t)}function ze(t,e,n){var o,i,r,a={};for(r in e)r=="key"?o=e[r]:r=="ref"?i=e[r]:a[r]=e[r];if(arguments.length>2&&(a.children=arguments.length>3?G.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(r in t.defaultProps)a[r]===void 0&&(a[r]=t.defaultProps[r]);return $(t,a,o,i,null)}function $(t,e,n,o,i){var r={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++he,__i:-1,__u:0};return i==null&&f.vnode!=null&&f.vnode(r),r}function F(t){return t.children}function q(t,e){this.props=t,this.context=e}function W(t,e){if(e==null)return t.__?W(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?W(t):null}function ye(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return ye(t)}}function de(t){(!t.__d&&(t.__d=!0)&&I.push(t)&&!B.__r++||ue!==f.debounceRendering)&&((ue=f.debounceRendering)||me)(B)}function B(){var t,e,n,o,i,r,a,l;for(I.sort(Y);t=I.shift();)t.__d&&(e=I.length,o=void 0,r=(i=(n=t).__v).__e,a=[],l=[],n.__P&&((o=S({},i)).__v=i.__v+1,f.vnode&&f.vnode(o),se(n.__P,o,i,n.__n,n.__P.namespaceURI,32&i.__u?[r]:null,a,r??W(i),!!(32&i.__u),l),o.__v=i.__v,o.__.__k[o.__i]=o,we(a,o,l),o.__e!=r&&ye(o)),I.length>e&&I.sort(Y));B.__r=0}function be(t,e,n,o,i,r,a,l,u,c,d){var s,y,_,g,k,v=o&&o.__k||ge,p=e.length;for(n.__d=u,Ve(n,e,v),u=n.__d,s=0;s<p;s++)(_=n.__k[s])!=null&&typeof _!="boolean"&&typeof _!="function"&&(y=_.__i===-1?V:v[_.__i]||V,_.__i=s,se(t,_,y,i,r,a,l,u,c,d),g=_.__e,_.ref&&y.ref!=_.ref&&(y.ref&&re(y.ref,null,_),d.push(_.ref,_.__c||g,_)),k==null&&g!=null&&(k=g),65536&_.__u||y.__k===_.__k?u=ke(_,u,t):typeof _.type=="function"&&_.__d!==void 0?u=_.__d:g&&(u=g.nextSibling),_.__d=void 0,_.__u&=-196609);n.__d=u,n.__e=k}function Ve(t,e,n){var o,i,r,a,l,u=e.length,c=n.length,d=c,s=0;for(t.__k=[],o=0;o<u;o++)a=o+s,(i=t.__k[o]=(i=e[o])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?$(null,i,null,null,null):ie(i)?$(F,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?$(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,l=Oe(i,n,a,d),i.__i=l,r=null,l!==-1&&(d--,(r=n[l])&&(r.__u|=131072)),r==null||r.__v===null?(l==-1&&s--,typeof i.type!="function"&&(i.__u|=65536)):l!==a&&(l==a-1?s--:l==a+1?s++:l>a?d>u-a?s+=l-a:s--:l<a&&(l==a-s?s-=l-a:s++),l!==o+s&&(i.__u|=65536))):(r=n[a])&&r.key==null&&r.__e&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=W(r)),ne(r,r,!1),n[a]=null,d--);if(d)for(o=0;o<c;o++)(r=n[o])!=null&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=W(r)),ne(r,r))}function ke(t,e,n){var o,i;if(typeof t.type=="function"){for(o=t.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=t,e=ke(o[i],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=W(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function Oe(t,e,n,o){var i=t.key,r=t.type,a=n-1,l=n+1,u=e[n];if(u===null||u&&i==u.key&&r===u.type&&!(131072&u.__u))return n;if(o>(u!=null&&!(131072&u.__u)?1:0))for(;a>=0||l<e.length;){if(a>=0){if((u=e[a])&&!(131072&u.__u)&&i==u.key&&r===u.type)return a;a--}if(l<e.length){if((u=e[l])&&!(131072&u.__u)&&i==u.key&&r===u.type)return l;l++}}return-1}function pe(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Me.test(e)?n:n+"px"}function j(t,e,n,o,i){var r;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||pe(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||pe(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")r=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||e==="onFocusOut"||e==="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o?n.u=o.u:(n.u=oe,t.addEventListener(e,r?te:ee,r)):t.removeEventListener(e,r?te:ee,r);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function fe(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=oe++;else if(e.t<n.u)return;return n(f.event?f.event(e):e)}}}function se(t,e,n,o,i,r,a,l,u,c){var d,s,y,_,g,k,v,p,h,T,P,U,M,ae,Z,Q,w=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),r=[l=e.__e=n.__e]),(d=f.__b)&&d(e);e:if(typeof w=="function")try{if(p=e.props,h="prototype"in w&&w.prototype.render,T=(d=w.contextType)&&o[d.__c],P=d?T?T.props.value:d.__:o,n.__c?v=(s=e.__c=n.__c).__=s.__E:(h?e.__c=s=new w(p,P):(e.__c=s=new q(p,P),s.constructor=w,s.render=Ze),T&&T.sub(s),s.props=p,s.state||(s.state={}),s.context=P,s.__n=o,y=s.__d=!0,s.__h=[],s._sb=[]),h&&s.__s==null&&(s.__s=s.state),h&&w.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=S({},s.__s)),S(s.__s,w.getDerivedStateFromProps(p,s.__s))),_=s.props,g=s.state,s.__v=e,y)h&&w.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),h&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(h&&w.getDerivedStateFromProps==null&&p!==_&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(p,P),!s.__e&&(s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(p,s.__s,P)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(s.props=p,s.state=s.__s,s.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(H){H&&(H.__=e)}),U=0;U<s._sb.length;U++)s.__h.push(s._sb[U]);s._sb=[],s.__h.length&&a.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(p,s.__s,P),h&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(_,g,k)})}if(s.context=P,s.props=p,s.__P=t,s.__e=!1,M=f.__r,ae=0,h){for(s.state=s.__s,s.__d=!1,M&&M(e),d=s.render(s.props,s.state,s.context),Z=0;Z<s._sb.length;Z++)s.__h.push(s._sb[Z]);s._sb=[]}else do s.__d=!1,M&&M(e),d=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++ae<25);s.state=s.__s,s.getChildContext!=null&&(o=S(S({},o),s.getChildContext())),h&&!y&&s.getSnapshotBeforeUpdate!=null&&(k=s.getSnapshotBeforeUpdate(_,g)),be(t,ie(Q=d!=null&&d.type===F&&d.key==null?d.props.children:d)?Q:[Q],e,n,o,i,r,a,l,u,c),s.base=e.__e,e.__u&=-161,s.__h.length&&a.push(s),v&&(s.__E=s.__=null)}catch(H){if(e.__v=null,u||r!=null){for(e.__u|=u?160:32;l&&l.nodeType===8&&l.nextSibling;)l=l.nextSibling;r[r.indexOf(l)]=null,e.__e=l}else e.__e=n.__e,e.__k=n.__k;f.__e(H,e,n)}else r==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=Ue(n.__e,e,n,o,i,r,a,u,c);(d=f.diffed)&&d(e)}function we(t,e,n){e.__d=void 0;for(var o=0;o<n.length;o++)re(n[o],n[++o],n[++o]);f.__c&&f.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(r){r.call(i)})}catch(r){f.__e(r,i.__v)}})}function Ue(t,e,n,o,i,r,a,l,u){var c,d,s,y,_,g,k,v=n.props,p=e.props,h=e.type;if(h==="svg"?i="http://www.w3.org/2000/svg":h==="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),r!=null){for(c=0;c<r.length;c++)if((_=r[c])&&"setAttribute"in _==!!h&&(h?_.localName===h:_.nodeType===3)){t=_,r[c]=null;break}}if(t==null){if(h===null)return document.createTextNode(p);t=document.createElementNS(i,h,p.is&&p),r=null,l=!1}if(h===null)v===p||l&&t.data===p||(t.data=p);else{if(r=r&&G.call(t.childNodes),v=n.props||V,!l&&r!=null)for(v={},c=0;c<t.attributes.length;c++)v[(_=t.attributes[c]).name]=_.value;for(c in v)if(_=v[c],c!="children"){if(c=="dangerouslySetInnerHTML")s=_;else if(c!=="key"&&!(c in p)){if(c=="value"&&"defaultValue"in p||c=="checked"&&"defaultChecked"in p)continue;j(t,c,null,_,i)}}for(c in p)_=p[c],c=="children"?y=_:c=="dangerouslySetInnerHTML"?d=_:c=="value"?g=_:c=="checked"?k=_:c==="key"||l&&typeof _!="function"||v[c]===_||j(t,c,_,v[c],i);if(d)l||s&&(d.__html===s.__html||d.__html===t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(s&&(t.innerHTML=""),be(t,ie(y)?y:[y],e,n,o,h==="foreignObject"?"http://www.w3.org/1999/xhtml":i,r,a,r?r[0]:n.__k&&W(n,0),l,u),r!=null)for(c=r.length;c--;)r[c]!=null&&ve(r[c]);l||(c="value",g!==void 0&&(g!==t[c]||h==="progress"&&!g||h==="option"&&g!==v[c])&&j(t,c,g,v[c],i),c="checked",k!==void 0&&k!==t[c]&&j(t,c,k,v[c],i))}return t}function re(t,e,n){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(i){f.__e(i,n)}}function ne(t,e,n){var o,i;if(f.unmount&&f.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||re(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(r){f.__e(r,e)}o.base=o.__P=null}if(o=t.__k)for(i=0;i<o.length;i++)o[i]&&ne(o[i],e,n||typeof t.type!="function");n||t.__e==null||ve(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function Ze(t,e,n){return this.constructor(t,n)}function E(t,e,n){var o,i,r,a;f.__&&f.__(t,e),i=(o=typeof n=="function")?null:n&&n.__k||e.__k,r=[],a=[],se(e,t=(!o&&n||e).__k=ze(F,null,[t]),i||V,V,e.namespaceURI,!o&&n?[n]:i?null:e.firstChild?G.call(e.childNodes):null,r,!o&&n?n:i?i.__e:e.firstChild,o,a),we(r,t,a)}G=ge.slice,f={__e:function(t,e,n,o){for(var i,r,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&r.getDerivedStateFromError!=null&&(i.setState(r.getDerivedStateFromError(t)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,o||{}),a=i.__d),a)return i.__E=i}catch(l){t=l}throw t}},he=0,Ee=function(t){return t!=null&&t.constructor==null},q.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=S({},this.state),typeof t=="function"&&(t=t(S({},n),this.props)),t&&S(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),de(this))},q.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),de(this))},q.prototype.render=F,I=[],me=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Y=function(t,e){return t.__v.__b-e.__v.__b},B.__r=0,oe=0,ee=fe(!1),te=fe(!0),Te=0;var He=0,Ke=Array.isArray;function m(t,e,n,o,i,r){e||(e={});var a,l,u=e;if("ref"in u)for(l in u={},e)l=="ref"?a=e[l]:u[l]=e[l];var c={type:t,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--He,__i:-1,__u:0,__source:i,__self:r};if(typeof t=="function"&&(a=t.defaultProps))for(l in a)u[l]===void 0&&(u[l]=a[l]);return f.vnode&&f.vnode(c),c}var xe=t=>{let{className:e,label:n,onClick:o}=t;return m("div",{className:"deck-widget-button",children:m("button",{className:`deck-widget-icon-button ${e}`,type:"button",onClick:o,title:n,children:m("div",{className:"deck-widget-icon"})})})},Ce=t=>{let{children:e,orientation:n}=t;return m("div",{className:`deck-widget-button-group ${n}`,children:e})},le=t=>{let{className:e,label:n,onClick:o}=t;return m("button",{className:`deck-widget-icon-button ${e}`,type:"button",onClick:o,title:n,children:m("div",{className:"deck-widget-icon"})})};var X=class{constructor(e){this.id="fullscreen";this.placement="top-left";this.fullscreen=!1;this.id=e.id??this.id,this.placement=e.placement??this.placement,this.props={...e,enterLabel:e.enterLabel??"Enter Fullscreen",exitLabel:e.exitLabel??"Exit Fullscreen",style:e.style??{}}}onAdd({deck:e}){let{style:n,className:o}=this.props,i=document.createElement("div");return i.classList.add("deck-widget","deck-widget-fullscreen"),o&&i.classList.add(o),(0,D._applyStyles)(i,n),this.deck=e,this.element=i,this.update(),document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this)),i}onRemove(){this.deck=void 0,this.element=void 0,document.removeEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}update(){let{enterLabel:e,exitLabel:n}=this.props,o=this.element;if(!o)return;let i=m(xe,{onClick:this.handleClick.bind(this),label:this.fullscreen?n:e,className:this.fullscreen?"deck-widget-fullscreen-exit":"deck-widget-fullscreen-enter"});E(i,o)}setProps(e){this.placement=e.placement??this.placement;let n=this.props,o=this.element;o&&(n.className!==e.className&&(n.className&&o.classList.remove(n.className),e.className&&o.classList.add(e.className)),(0,D._deepEqual)(n.style,e.style,1)||((0,D._removeStyles)(o,n.style),(0,D._applyStyles)(o,e.style))),Object.assign(this.props,e),this.update()}getContainer(){return this.props.container||this.deck?.getCanvas()?.parentElement}onFullscreenChange(){let e=this.fullscreen,n=document.fullscreenElement===this.getContainer();e!==n&&(this.fullscreen=!this.fullscreen),this.update()}async handleClick(){this.fullscreen?await this.exitFullscreen():await this.requestFullscreen(),this.update()}async requestFullscreen(){let e=this.getContainer();e?.requestFullscreen?await e.requestFullscreen({navigationUI:"hide"}):this.togglePseudoFullscreen()}async exitFullscreen(){document.exitFullscreen?await document.exitFullscreen():this.togglePseudoFullscreen()}togglePseudoFullscreen(){this.getContainer()?.classList.toggle("deck-pseudo-fullscreen")}};var b=z(N(),1);var J=class{constructor(e){this.id="compass";this.placement="top-left";this.viewId=null;this.viewports={};this.id=e.id??this.id,this.viewId=e.viewId??this.viewId,this.placement=e.placement??this.placement,this.props={...e,transitionDuration:e.transitionDuration??200,label:e.label??"Reset Compass",style:e.style??{}}}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId;let n=this.props,o=this.element;o&&(n.className!==e.className&&(n.className&&o.classList.remove(n.className),e.className&&o.classList.add(e.className)),(0,b._deepEqual)(n.style,e.style,1)||((0,b._removeStyles)(o,n.style),(0,b._applyStyles)(o,e.style))),Object.assign(this.props,e),this.update()}onViewportChange(e){e.equals(this.viewports[e.id])||(this.viewports[e.id]=e,this.update())}onAdd({deck:e}){let{style:n,className:o}=this.props,i=document.createElement("div");return i.classList.add("deck-widget","deck-widget-compass"),o&&i.classList.add(o),(0,b._applyStyles)(i,n),this.deck=e,this.element=i,this.update(),i}getRotation(e){return e instanceof b.WebMercatorViewport?[-e.bearing,e.pitch]:e instanceof b._GlobeViewport?[0,Math.max(-80,Math.min(80,e.latitude))]:[0,0]}update(){let e=this.viewId||Object.values(this.viewports)[0]?.id||"default-view",n=this.viewports[e],[o,i]=this.getRotation(n),r=this.element;if(!r)return;let a=m("div",{className:"deck-widget-button",style:{perspective:100},children:m("button",{type:"button",onClick:()=>{for(let l of Object.values(this.viewports))this.handleCompassReset(l)},title:this.props.label,style:{transform:`rotateX(${i}deg)`},children:m("svg",{fill:"none",width:"100%",height:"100%",viewBox:"0 0 26 26",children:m("g",{transform:`rotate(${o},13,13)`,children:[m("path",{d:"M10 13.0001L12.9999 5L15.9997 13.0001H10Z",fill:"var(--icon-compass-north-color, #F05C44)"}),m("path",{d:"M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z",fill:"var(--icon-compass-south-color, #C2C2CC)"})]})})})});E(a,r)}onRemove(){this.deck=void 0,this.element=void 0}handleCompassReset(e){let n=this.viewId||e.id||"default-view";if(e instanceof b.WebMercatorViewport){let o={...e,bearing:0,...this.getRotation(e)[0]===0?{pitch:0}:{},transitionDuration:this.props.transitionDuration,transitionInterpolator:new b.FlyToInterpolator};this.deck._onViewStateChange({viewId:n,viewState:o,interactionState:{}})}}};var C=z(N(),1);var K=class{constructor(e){this.id="zoom";this.placement="top-left";this.viewId=null;this.viewports={};this.id=e.id??this.id,this.viewId=e.viewId??this.viewId,this.placement=e.placement??this.placement,this.props={...e,orientation:e.orientation??"vertical",transitionDuration:e.transitionDuration??200,zoomInLabel:e.zoomInLabel??"Zoom In",zoomOutLabel:e.zoomOutLabel??"Zoom Out",style:e.style??{}}}onAdd({deck:e}){let{style:n,className:o}=this.props,i=document.createElement("div");return i.classList.add("deck-widget","deck-widget-zoom"),o&&i.classList.add(o),(0,C._applyStyles)(i,n),this.deck=e,this.element=i,this.update(),i}onRemove(){this.deck=void 0,this.element=void 0}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId;let n=this.props,o=this.element;o&&(n.className!==e.className&&(n.className&&o.classList.remove(n.className),e.className&&o.classList.add(e.className)),(0,C._deepEqual)(n.style,e.style,1)||((0,C._removeStyles)(o,n.style),(0,C._applyStyles)(o,e.style))),Object.assign(this.props,e),this.update()}onViewportChange(e){this.viewports[e.id]=e}handleZoom(e,n){let o=this.viewId||e?.id||"default-view",i={...e,zoom:n,transitionDuration:this.props.transitionDuration,transitionInterpolator:new C.FlyToInterpolator};this.deck._onViewStateChange({viewId:o,viewState:i,interactionState:{}})}handleZoomIn(){for(let e of Object.values(this.viewports))this.handleZoom(e,e.zoom+1)}handleZoomOut(){for(let e of Object.values(this.viewports))this.handleZoom(e,e.zoom-1)}update(){let e=this.element;if(!e)return;let n=m(Ce,{orientation:this.props.orientation,children:[m(le,{onClick:()=>this.handleZoomIn(),label:this.props.zoomInLabel,className:"deck-widget-zoom-in"}),m(le,{onClick:()=>this.handleZoomOut(),label:this.props.zoomOutLabel,className:"deck-widget-zoom-out"})]});E(n,e)}};var Re={"--button-background":"#fff","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},Ae={"--button-background":"rgba(18, 18, 20, 1)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},je={"--button-background":"rgba(255, 255, 255, 0.6)","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"1px solid rgba(255, 255, 255, 0.6)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},$e={"--button-background":"rgba(18, 18, 20, 0.75)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"1px solid rgba(18, 18, 20, 0.75)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"};return Fe(O);})();
|
|
7
|
+
"use strict";var __exports__=(()=>{var Fe=Object.create;var X=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var Ve=Object.getOwnPropertyNames;var Me=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty;var Ue=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),ye=(n,e)=>{for(var t in e)X(n,t,{get:e[t],enumerable:!0})},G=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ve(e))!He.call(n,i)&&i!==t&&X(n,i,{get:()=>e[i],enumerable:!(o=Te(e,i))||o.enumerable});return n},L=(n,e,t)=>(G(n,e,"default"),t&&G(t,e,"default")),V=(n,e,t)=>(t=n!=null?Fe(Me(n)):{},G(e||!n||!n.__esModule?X(t,"default",{value:n,enumerable:!0}):t,n)),qe=n=>G(X({},"__esModule",{value:!0}),n);var I=Ue((tt,be)=>{be.exports=globalThis.deck});var A={};ye(A,{CompassWidget:()=>oe,DarkGlassTheme:()=>Ye,DarkTheme:()=>Ke,FullscreenWidget:()=>ne,LightGlassTheme:()=>Qe,LightTheme:()=>Je,ResetViewWidget:()=>Z,ScreenshotWidget:()=>O,ZoomWidget:()=>z,_WidgetImpl:()=>P,_components:()=>me});var C={},we=V(I(),1);L(C,V(I(),1));if(!we.Layer)throw new Error("@deck.gl/core is not found");L(A,C);var F=V(I(),1);var ee,f,Se,ze,D,ke,We,se,ce,re,le,Oe,q={},Le=[],Ze=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,de=Array.isArray;function N(n,e){for(var t in e)n[t]=e[t];return n}function Ne(n){var e=n.parentNode;e&&e.removeChild(n)}function Ae(n,e,t){var o,i,r,l={};for(r in e)r=="key"?o=e[r]:r=="ref"?i=e[r]:l[r]=e[r];if(arguments.length>2&&(l.children=arguments.length>3?ee.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(r in n.defaultProps)l[r]===void 0&&(l[r]=n.defaultProps[r]);return K(n,l,o,i,null)}function K(n,e,t,o,i){var r={type:n,props:e,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++Se,__i:-1,__u:0};return i==null&&f.vnode!=null&&f.vnode(r),r}function M(n){return n.children}function Q(n,e){this.props=n,this.context=e}function R(n,e){if(e==null)return n.__?R(n.__,n.__i+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?R(n):null}function Ie(n){var e,t;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,e=0;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null){n.__e=n.__c.base=t.__e;break}return Ie(n)}}function Pe(n){(!n.__d&&(n.__d=!0)&&D.push(n)&&!Y.__r++||ke!==f.debounceRendering)&&((ke=f.debounceRendering)||We)(Y)}function Y(){var n,e,t,o,i,r,l,a;for(D.sort(se);n=D.shift();)n.__d&&(e=D.length,o=void 0,r=(i=(t=n).__v).__e,l=[],a=[],t.__P&&((o=N({},i)).__v=i.__v+1,f.vnode&&f.vnode(o),pe(t.__P,o,i,t.__n,t.__P.namespaceURI,32&i.__u?[r]:null,l,r??R(i),!!(32&i.__u),a),o.__v=i.__v,o.__.__k[o.__i]=o,Ee(l,o,a),o.__e!=r&&Ie(o)),D.length>e&&D.sort(se));Y.__r=0}function De(n,e,t,o,i,r,l,a,p,c,_){var s,y,d,g,w,v=o&&o.__k||Le,m=e.length;for(t.__d=p,je(t,e,v),p=t.__d,s=0;s<m;s++)(d=t.__k[s])!=null&&typeof d!="boolean"&&typeof d!="function"&&(y=d.__i===-1?q:v[d.__i]||q,d.__i=s,pe(n,d,y,i,r,l,a,p,c,_),g=d.__e,d.ref&&y.ref!=d.ref&&(y.ref&&_e(y.ref,null,d),_.push(d.ref,d.__c||g,d)),w==null&&g!=null&&(w=g),65536&d.__u||y.__k===d.__k?p=Re(d,p,n):typeof d.type=="function"&&d.__d!==void 0?p=d.__d:g&&(p=g.nextSibling),d.__d=void 0,d.__u&=-196609);t.__d=p,t.__e=w}function je(n,e,t){var o,i,r,l,a,p=e.length,c=t.length,_=c,s=0;for(n.__k=[],o=0;o<p;o++)l=o+s,(i=n.__k[o]=(i=e[o])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?K(null,i,null,null,null):de(i)?K(M,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?K(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=n,i.__b=n.__b+1,a=Be(i,t,l,_),i.__i=a,r=null,a!==-1&&(_--,(r=t[a])&&(r.__u|=131072)),r==null||r.__v===null?(a==-1&&s--,typeof i.type!="function"&&(i.__u|=65536)):a!==l&&(a==l-1?s--:a==l+1?s++:a>l?_>p-l?s+=a-l:s--:a<l&&(a==l-s?s-=a-l:s++),a!==o+s&&(i.__u|=65536))):(r=t[l])&&r.key==null&&r.__e&&!(131072&r.__u)&&(r.__e==n.__d&&(n.__d=R(r)),ae(r,r,!1),t[l]=null,_--);if(_)for(o=0;o<c;o++)(r=t[o])!=null&&!(131072&r.__u)&&(r.__e==n.__d&&(n.__d=R(r)),ae(r,r))}function Re(n,e,t){var o,i;if(typeof n.type=="function"){for(o=n.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=n,e=Re(o[i],e,t));return e}n.__e!=e&&(e&&n.type&&!t.contains(e)&&(e=R(n)),t.insertBefore(n.__e,e||null),e=n.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function Be(n,e,t,o){var i=n.key,r=n.type,l=t-1,a=t+1,p=e[t];if(p===null||p&&i==p.key&&r===p.type&&!(131072&p.__u))return t;if(o>(p!=null&&!(131072&p.__u)?1:0))for(;l>=0||a<e.length;){if(l>=0){if((p=e[l])&&!(131072&p.__u)&&i==p.key&&r===p.type)return l;l--}if(a<e.length){if((p=e[a])&&!(131072&p.__u)&&i==p.key&&r===p.type)return a;a++}}return-1}function xe(n,e,t){e[0]==="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||Ze.test(e)?t:t+"px"}function J(n,e,t,o,i){var r;e:if(e==="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof o=="string"&&(n.style.cssText=o=""),o)for(e in o)t&&e in t||xe(n.style,e,"");if(t)for(e in t)o&&t[e]===o[e]||xe(n.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")r=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in n||e==="onFocusOut"||e==="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),n.l||(n.l={}),n.l[e+r]=t,t?o?t.u=o.u:(t.u=ce,n.addEventListener(e,r?le:re,r)):n.removeEventListener(e,r?le:re,r);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in n)try{n[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?n.removeAttribute(e):n.setAttribute(e,e=="popover"&&t==1?"":t))}}function Ce(n){return function(e){if(this.l){var t=this.l[e.type+n];if(e.t==null)e.t=ce++;else if(e.t<t.u)return;return t(f.event?f.event(e):e)}}}function pe(n,e,t,o,i,r,l,a,p,c){var _,s,y,d,g,w,v,m,h,H,W,j,U,ve,B,ie,x=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(p=!!(32&t.__u),r=[a=e.__e=t.__e]),(_=f.__b)&&_(e);e:if(typeof x=="function")try{if(m=e.props,h="prototype"in x&&x.prototype.render,H=(_=x.contextType)&&o[_.__c],W=_?H?H.props.value:_.__:o,t.__c?v=(s=e.__c=t.__c).__=s.__E:(h?e.__c=s=new x(m,W):(e.__c=s=new Q(m,W),s.constructor=x,s.render=Ge),H&&H.sub(s),s.props=m,s.state||(s.state={}),s.context=W,s.__n=o,y=s.__d=!0,s.__h=[],s._sb=[]),h&&s.__s==null&&(s.__s=s.state),h&&x.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=N({},s.__s)),N(s.__s,x.getDerivedStateFromProps(m,s.__s))),d=s.props,g=s.state,s.__v=e,y)h&&x.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),h&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(h&&x.getDerivedStateFromProps==null&&m!==d&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(m,W),!s.__e&&(s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(m,s.__s,W)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(s.props=m,s.state=s.__s,s.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function($){$&&($.__=e)}),j=0;j<s._sb.length;j++)s.__h.push(s._sb[j]);s._sb=[],s.__h.length&&l.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(m,s.__s,W),h&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(d,g,w)})}if(s.context=W,s.props=m,s.__P=n,s.__e=!1,U=f.__r,ve=0,h){for(s.state=s.__s,s.__d=!1,U&&U(e),_=s.render(s.props,s.state,s.context),B=0;B<s._sb.length;B++)s.__h.push(s._sb[B]);s._sb=[]}else do s.__d=!1,U&&U(e),_=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++ve<25);s.state=s.__s,s.getChildContext!=null&&(o=N(N({},o),s.getChildContext())),h&&!y&&s.getSnapshotBeforeUpdate!=null&&(w=s.getSnapshotBeforeUpdate(d,g)),De(n,de(ie=_!=null&&_.type===M&&_.key==null?_.props.children:_)?ie:[ie],e,t,o,i,r,l,a,p,c),s.base=e.__e,e.__u&=-161,s.__h.length&&l.push(s),v&&(s.__E=s.__=null)}catch($){if(e.__v=null,p||r!=null){for(e.__u|=p?160:32;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;r[r.indexOf(a)]=null,e.__e=a}else e.__e=t.__e,e.__k=t.__k;f.__e($,e,t)}else r==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=$e(t.__e,e,t,o,i,r,l,p,c);(_=f.diffed)&&_(e)}function Ee(n,e,t){e.__d=void 0;for(var o=0;o<t.length;o++)_e(t[o],t[++o],t[++o]);f.__c&&f.__c(e,n),n.some(function(i){try{n=i.__h,i.__h=[],n.some(function(r){r.call(i)})}catch(r){f.__e(r,i.__v)}})}function $e(n,e,t,o,i,r,l,a,p){var c,_,s,y,d,g,w,v=t.props,m=e.props,h=e.type;if(h==="svg"?i="http://www.w3.org/2000/svg":h==="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),r!=null){for(c=0;c<r.length;c++)if((d=r[c])&&"setAttribute"in d==!!h&&(h?d.localName===h:d.nodeType===3)){n=d,r[c]=null;break}}if(n==null){if(h===null)return document.createTextNode(m);n=document.createElementNS(i,h,m.is&&m),r=null,a=!1}if(h===null)v===m||a&&n.data===m||(n.data=m);else{if(r=r&&ee.call(n.childNodes),v=t.props||q,!a&&r!=null)for(v={},c=0;c<n.attributes.length;c++)v[(d=n.attributes[c]).name]=d.value;for(c in v)if(d=v[c],c!="children"){if(c=="dangerouslySetInnerHTML")s=d;else if(c!=="key"&&!(c in m)){if(c=="value"&&"defaultValue"in m||c=="checked"&&"defaultChecked"in m)continue;J(n,c,null,d,i)}}for(c in m)d=m[c],c=="children"?y=d:c=="dangerouslySetInnerHTML"?_=d:c=="value"?g=d:c=="checked"?w=d:c==="key"||a&&typeof d!="function"||v[c]===d||J(n,c,d,v[c],i);if(_)a||s&&(_.__html===s.__html||_.__html===n.innerHTML)||(n.innerHTML=_.__html),e.__k=[];else if(s&&(n.innerHTML=""),De(n,de(y)?y:[y],e,t,o,h==="foreignObject"?"http://www.w3.org/1999/xhtml":i,r,l,r?r[0]:t.__k&&R(t,0),a,p),r!=null)for(c=r.length;c--;)r[c]!=null&&Ne(r[c]);a||(c="value",g!==void 0&&(g!==n[c]||h==="progress"&&!g||h==="option"&&g!==v[c])&&J(n,c,g,v[c],i),c="checked",w!==void 0&&w!==n[c]&&J(n,c,w,v[c],i))}return n}function _e(n,e,t){try{if(typeof n=="function"){var o=typeof n.__u=="function";o&&n.__u(),o&&e==null||(n.__u=n(e))}else n.current=e}catch(i){f.__e(i,t)}}function ae(n,e,t){var o,i;if(f.unmount&&f.unmount(n),(o=n.ref)&&(o.current&&o.current!==n.__e||_e(o,null,e)),(o=n.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(r){f.__e(r,e)}o.base=o.__P=null}if(o=n.__k)for(i=0;i<o.length;i++)o[i]&&ae(o[i],e,t||typeof n.type!="function");t||n.__e==null||Ne(n.__e),n.__c=n.__=n.__e=n.__d=void 0}function Ge(n,e,t){return this.constructor(n,t)}function S(n,e,t){var o,i,r,l;f.__&&f.__(n,e),i=(o=typeof t=="function")?null:t&&t.__k||e.__k,r=[],l=[],pe(e,n=(!o&&t||e).__k=Ae(M,null,[n]),i||q,q,e.namespaceURI,!o&&t?[t]:i?null:e.firstChild?ee.call(e.childNodes):null,r,!o&&t?t:i?i.__e:e.firstChild,o,l),Ee(r,n,l)}ee=Le.slice,f={__e:function(n,e,t,o){for(var i,r,l;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&r.getDerivedStateFromError!=null&&(i.setState(r.getDerivedStateFromError(n)),l=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(n,o||{}),l=i.__d),l)return i.__E=i}catch(a){n=a}throw n}},Se=0,ze=function(n){return n!=null&&n.constructor==null},Q.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=N({},this.state),typeof n=="function"&&(n=n(N({},t),this.props)),n&&N(t,n),n!=null&&this.__v&&(e&&this._sb.push(e),Pe(this))},Q.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),Pe(this))},Q.prototype.render=M,D=[],We=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,se=function(n,e){return n.__v.__b-e.__v.__b},Y.__r=0,ce=0,re=Ce(!1),le=Ce(!0),Oe=0;var me={};ye(me,{ButtonGroup:()=>ue,GroupedIconButton:()=>te,IconButton:()=>E});var Xe=0,st=Array.isArray;function u(n,e,t,o,i,r){e||(e={});var l,a,p=e;if("ref"in p)for(a in p={},e)a=="ref"?l=e[a]:p[a]=e[a];var c={type:n,props:p,key:t,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Xe,__i:-1,__u:0,__source:i,__self:r};if(typeof n=="function"&&(l=n.defaultProps))for(a in l)p[a]===void 0&&(p[a]=l[a]);return f.vnode&&f.vnode(c),c}var E=n=>{let{className:e,label:t,onClick:o}=n;return u("div",{className:"deck-widget-button",children:u("button",{className:`deck-widget-icon-button ${e}`,type:"button",onClick:o,title:t,children:u("div",{className:"deck-widget-icon"})})})},ue=n=>{let{children:e,orientation:t}=n;return u("div",{className:`deck-widget-button-group ${t}`,children:e})},te=n=>{let{className:e,label:t,onClick:o}=n;return u("button",{className:`deck-widget-icon-button ${e}`,type:"button",onClick:o,title:t,children:u("div",{className:"deck-widget-icon"})})};var ne=class{constructor(e){this.id="fullscreen";this.placement="top-left";this.fullscreen=!1;this.id=e.id??this.id,this.placement=e.placement??this.placement,this.props={...e,enterLabel:e.enterLabel??"Enter Fullscreen",exitLabel:e.exitLabel??"Exit Fullscreen",style:e.style??{}}}onAdd({deck:e}){let{style:t,className:o}=this.props,i=document.createElement("div");return i.classList.add("deck-widget","deck-widget-fullscreen"),o&&i.classList.add(o),(0,F._applyStyles)(i,t),this.deck=e,this.element=i,this.update(),document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this)),i}onRemove(){this.deck=void 0,this.element=void 0,document.removeEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}update(){let{enterLabel:e,exitLabel:t}=this.props,o=this.element;if(!o)return;let i=u(E,{onClick:this.handleClick.bind(this),label:this.fullscreen?t:e,className:this.fullscreen?"deck-widget-fullscreen-exit":"deck-widget-fullscreen-enter"});S(i,o)}setProps(e){this.placement=e.placement??this.placement;let t=this.props,o=this.element;o&&(t.className!==e.className&&(t.className&&o.classList.remove(t.className),e.className&&o.classList.add(e.className)),(0,F._deepEqual)(t.style,e.style,1)||((0,F._removeStyles)(o,t.style),(0,F._applyStyles)(o,e.style))),Object.assign(this.props,e),this.update()}getContainer(){return this.props.container||this.deck?.getCanvas()?.parentElement}onFullscreenChange(){let e=this.fullscreen,t=document.fullscreenElement===this.getContainer();e!==t&&(this.fullscreen=!this.fullscreen),this.update()}async handleClick(){this.fullscreen?await this.exitFullscreen():await this.requestFullscreen(),this.update()}async requestFullscreen(){let e=this.getContainer();e?.requestFullscreen?await e.requestFullscreen({navigationUI:"hide"}):this.togglePseudoFullscreen()}async exitFullscreen(){document.exitFullscreen?await document.exitFullscreen():this.togglePseudoFullscreen()}togglePseudoFullscreen(){this.getContainer()?.classList.toggle("deck-pseudo-fullscreen")}};var b=V(I(),1);var oe=class{constructor(e){this.id="compass";this.placement="top-left";this.viewId=null;this.viewports={};this.id=e.id??this.id,this.viewId=e.viewId??this.viewId,this.placement=e.placement??this.placement,this.props={...e,transitionDuration:e.transitionDuration??200,label:e.label??"Reset Compass",style:e.style??{}}}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId;let t=this.props,o=this.element;o&&(t.className!==e.className&&(t.className&&o.classList.remove(t.className),e.className&&o.classList.add(e.className)),(0,b._deepEqual)(t.style,e.style,1)||((0,b._removeStyles)(o,t.style),(0,b._applyStyles)(o,e.style))),Object.assign(this.props,e),this.update()}onViewportChange(e){e.equals(this.viewports[e.id])||(this.viewports[e.id]=e,this.update())}onAdd({deck:e}){let{style:t,className:o}=this.props,i=document.createElement("div");return i.classList.add("deck-widget","deck-widget-compass"),o&&i.classList.add(o),(0,b._applyStyles)(i,t),this.deck=e,this.element=i,this.update(),i}getRotation(e){return e instanceof b.WebMercatorViewport?[-e.bearing,e.pitch]:e instanceof b._GlobeViewport?[0,Math.max(-80,Math.min(80,e.latitude))]:[0,0]}update(){let e=this.viewId||Object.values(this.viewports)[0]?.id||"default-view",t=this.viewports[e],[o,i]=this.getRotation(t),r=this.element;if(!r)return;let l=u("div",{className:"deck-widget-button",style:{perspective:100},children:u("button",{type:"button",onClick:()=>{for(let a of Object.values(this.viewports))this.handleCompassReset(a)},title:this.props.label,style:{transform:`rotateX(${i}deg)`},children:u("svg",{fill:"none",width:"100%",height:"100%",viewBox:"0 0 26 26",children:u("g",{transform:`rotate(${o},13,13)`,children:[u("path",{d:"M10 13.0001L12.9999 5L15.9997 13.0001H10Z",fill:"var(--icon-compass-north-color, #F05C44)"}),u("path",{d:"M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z",fill:"var(--icon-compass-south-color, #C2C2CC)"})]})})})});S(l,r)}onRemove(){this.deck=void 0,this.element=void 0}handleCompassReset(e){let t=this.viewId||e.id||"default-view";if(e instanceof b.WebMercatorViewport){let o={...e,bearing:0,...this.getRotation(e)[0]===0?{pitch:0}:{},transitionDuration:this.props.transitionDuration,transitionInterpolator:new b.FlyToInterpolator};this.deck._onViewStateChange({viewId:t,viewState:o,interactionState:{}})}}};var k=V(I(),1);var fe=class{constructor(e={}){this.id="zoom";this.placement="top-left";this.viewId=null;this.viewports={};this.id=e.id??this.id,this.viewId=e.viewId??this.viewId,this.placement=e.placement??this.placement,this.props={...fe.defaultProps,...e}}onAdd({deck:e}){let{style:t,className:o}=this.props,i=document.createElement("div");return i.classList.add("deck-widget","deck-widget-zoom"),o&&i.classList.add(o),(0,k._applyStyles)(i,t),this.deck=e,this.element=i,this.update(),i}onRemove(){this.deck=void 0,this.element=void 0}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId;let t=this.props,o=this.element;o&&(t.className!==e.className&&(t.className&&o.classList.remove(t.className),e.className&&o.classList.add(e.className)),(0,k._deepEqual)(t.style,e.style,1)||((0,k._removeStyles)(o,t.style),(0,k._applyStyles)(o,e.style))),Object.assign(this.props,e),this.update()}onViewportChange(e){this.viewports[e.id]=e}handleZoom(e,t){let o=this.viewId||e?.id||"default-view",i={...e,zoom:t};this.props.transitionDuration>0&&(i.transitionDuration=this.props.transitionDuration,i.transitionInterpolator="latitude"in i?new k.FlyToInterpolator:new k.LinearInterpolator),this.setViewState(o,i)}handleZoomIn(){for(let e of Object.values(this.viewports))this.handleZoom(e,e.zoom+1)}handleZoomOut(){for(let e of Object.values(this.viewports))this.handleZoom(e,e.zoom-1)}setViewState(e,t){this.deck._onViewStateChange({viewId:e,viewState:t,interactionState:{}})}update(){let e=this.element;if(!e)return;let t=u(ue,{orientation:this.props.orientation,children:[u(te,{onClick:()=>this.handleZoomIn(),label:this.props.zoomInLabel,className:"deck-widget-zoom-in"}),u(te,{onClick:()=>this.handleZoomOut(),label:this.props.zoomOutLabel,className:"deck-widget-zoom-out"})]});S(t,e)}},z=fe;z.defaultProps={id:"zoom-widget",style:{},placement:"top-left",className:void 0,orientation:"vertical",transitionDuration:200,zoomInLabel:"Zoom In",zoomOutLabel:"Zoom Out",viewId:void 0};var T=V(I(),1),P=class{constructor(e){this.id=e.id||"widget",this.props=e}onAdd({deck:e}){this.deck=e;let{style:t,className:o}=this.props,i=this._createRootElement({widgetClassName:this.className,className:o,style:t});return this.element=i,this.onRenderHTML(),this.element}onRemove(){this.deck=void 0,this.element=void 0}setProps(e){let t=this.props,o=this.element;o&&(t.className!==e.className&&(t.className&&o.classList.remove(t.className),e.className&&o.classList.add(e.className)),(0,T._deepEqual)(t.style,e.style,1)||((0,T._removeStyles)(o,t.style),(0,T._applyStyles)(o,e.style))),Object.assign(this.props,e),this.onRenderHTML()}_createRootElement(e){let{widgetClassName:t,className:o,style:i}=e,r=document.createElement("div");return["deck-widget",t,o].filter(l=>typeof l=="string"&&l.length>0).forEach(l=>r.classList.add(l)),(0,T._applyStyles)(r,i),r}};P.defaultProps={id:"widget",style:{},className:""};var he=class extends P{constructor(t={}){super({...he.defaultProps,...t});this.className="deck-widget-screenshot";this.placement="top-left";this.placement=t.placement??this.placement}setProps(t){this.placement=t.placement??this.placement,super.setProps(t)}onRenderHTML(){let t=this.element;t&&S(u(E,{className:"deck-widget-camera",label:this.props.label,onClick:this.handleClick.bind(this)}),t)}handleClick(){if(this.props.onCapture){this.props.onCapture(this);return}let t=this.captureScreenToDataURL(this.props.imageFormat);t&&this.downloadDataURL(t,this.props.filename)}captureScreenToDataURL(t){return this.deck?.getCanvas()?.toDataURL(t)}downloadDataURL(t,o){let i=document.createElement("a");i.href=t,i.download=o,i.click()}},O=he;O.defaultProps={...P.defaultProps,id:"screenshot",placement:"top-left",label:"Screenshot",filename:"screenshot.png",imageFormat:"image/png",onCapture:void 0};var ge=class extends P{constructor(t={}){super({...ge.defaultProps,...t});this.className="deck-widget-reset-view";this.placement="top-left";this.placement=t.placement??this.placement}setProps(t){this.placement=t.placement??this.placement,super.setProps(t)}onRenderHTML(){let t=this.element;t&&S(u(E,{className:"deck-widget-reset-focus",label:this.props.label,onClick:this.handleClick.bind(this)}),t)}handleClick(){let t=this.props.initialViewState||this.deck?.props.initialViewState;this.setViewState(t)}setViewState(t){let o=this.props.viewId||t?.id||"default-view",i={...t};this.deck._onViewStateChange({viewId:o,viewState:i,interactionState:{}})}},Z=ge;Z.defaultProps={...P.defaultProps,id:"reset-view",placement:"top-left",label:"Reset View",initialViewState:void 0,viewId:void 0};var Je={"--button-background":"#fff","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},Ke={"--button-background":"rgba(18, 18, 20, 1)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},Qe={"--button-background":"rgba(255, 255, 255, 0.6)","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"1px solid rgba(255, 255, 255, 0.6)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},Ye={"--button-background":"rgba(18, 18, 20, 0.75)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"1px solid rgba(18, 18, 20, 0.75)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"};return qe(A);})();
|
|
8
8
|
return __exports__;
|
|
9
9
|
});
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "UI widgets for deck.gl",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "9.1.
|
|
6
|
+
"version": "9.1.5",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@deck.gl/core": "^9.1.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "0223094f8c74c1db4a20bb9e5180b405d0809732"
|
|
51
51
|
}
|
package/src/index.ts
CHANGED
|
@@ -5,9 +5,18 @@
|
|
|
5
5
|
export {FullscreenWidget} from './fullscreen-widget';
|
|
6
6
|
export {CompassWidget} from './compass-widget';
|
|
7
7
|
export {ZoomWidget} from './zoom-widget';
|
|
8
|
+
export {ScreenshotWidget} from './screenshot-widget';
|
|
9
|
+
export {ResetViewWidget} from './reset-view-widget';
|
|
8
10
|
|
|
9
11
|
export type {FullscreenWidgetProps} from './fullscreen-widget';
|
|
10
12
|
export type {CompassWidgetProps} from './compass-widget';
|
|
11
13
|
export type {ZoomWidgetProps} from './zoom-widget';
|
|
14
|
+
export type {ScreenshotWidgetProps} from './screenshot-widget';
|
|
15
|
+
export type {ResetViewWidgetProps} from './reset-view-widget';
|
|
16
|
+
|
|
17
|
+
export type {WidgetImplProps} from './widget-impl';
|
|
18
|
+
export {WidgetImpl as _WidgetImpl} from './widget-impl';
|
|
19
|
+
import * as _components from './components';
|
|
20
|
+
export {_components};
|
|
12
21
|
|
|
13
22
|
export * from './themes';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
/* global document */
|
|
6
|
+
import type {WidgetPlacement} from '@deck.gl/core';
|
|
7
|
+
import {render} from 'preact';
|
|
8
|
+
import {WidgetImpl, WidgetImplProps} from './widget-impl';
|
|
9
|
+
import {IconButton} from './components';
|
|
10
|
+
|
|
11
|
+
/** @todo - is the the best we can do? */
|
|
12
|
+
type ViewState = Record<string, unknown>;
|
|
13
|
+
|
|
14
|
+
/** Properties for the ResetViewWidget */
|
|
15
|
+
export type ResetViewWidgetProps = WidgetImplProps & {
|
|
16
|
+
/** Widget positioning within the view. Default 'top-left'. */
|
|
17
|
+
placement?: WidgetPlacement;
|
|
18
|
+
/** Tooltip message */
|
|
19
|
+
label?: string;
|
|
20
|
+
/** The initial view state to reset the view to. Defaults to deck.props.initialViewState */
|
|
21
|
+
initialViewState?: ViewState;
|
|
22
|
+
/** View to interact with. Required when using multiple views. */
|
|
23
|
+
viewId?: string | null;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A button widget that resets the view state of deck to an initial state.
|
|
28
|
+
*/
|
|
29
|
+
export class ResetViewWidget extends WidgetImpl<ResetViewWidgetProps> {
|
|
30
|
+
static defaultProps: Required<ResetViewWidgetProps> = {
|
|
31
|
+
...WidgetImpl.defaultProps,
|
|
32
|
+
id: 'reset-view',
|
|
33
|
+
placement: 'top-left',
|
|
34
|
+
label: 'Reset View',
|
|
35
|
+
initialViewState: undefined!,
|
|
36
|
+
viewId: undefined!
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
className = 'deck-widget-reset-view';
|
|
40
|
+
placement: WidgetPlacement = 'top-left';
|
|
41
|
+
|
|
42
|
+
constructor(props: ResetViewWidgetProps = {}) {
|
|
43
|
+
super({...ResetViewWidget.defaultProps, ...props});
|
|
44
|
+
this.placement = props.placement ?? this.placement;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
setProps(props: Partial<ResetViewWidgetProps>) {
|
|
48
|
+
this.placement = props.placement ?? this.placement;
|
|
49
|
+
super.setProps(props);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
onRenderHTML() {
|
|
53
|
+
const element = this.element;
|
|
54
|
+
if (!element) return;
|
|
55
|
+
render(
|
|
56
|
+
<IconButton
|
|
57
|
+
className="deck-widget-reset-focus"
|
|
58
|
+
label={this.props.label}
|
|
59
|
+
onClick={this.handleClick.bind(this)}
|
|
60
|
+
/>,
|
|
61
|
+
element
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
handleClick() {
|
|
66
|
+
const initialViewState = this.props.initialViewState || this.deck?.props.initialViewState;
|
|
67
|
+
this.setViewState(initialViewState);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
setViewState(viewState: ViewState) {
|
|
71
|
+
const viewId = this.props.viewId || viewState?.id || 'default-view';
|
|
72
|
+
const nextViewState = {
|
|
73
|
+
...viewState
|
|
74
|
+
// only works for geospatial?
|
|
75
|
+
// transitionDuration: this.props.transitionDuration,
|
|
76
|
+
// transitionInterpolator: new FlyToInterpolator()
|
|
77
|
+
};
|
|
78
|
+
// @ts-ignore Using private method temporary until there's a public one
|
|
79
|
+
this.deck._onViewStateChange({viewId, viewState: nextViewState, interactionState: {}});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
/* global document */
|
|
6
|
+
import {WidgetImpl, WidgetImplProps} from './widget-impl';
|
|
7
|
+
import {h, render} from 'preact';
|
|
8
|
+
import {IconButton} from './components';
|
|
9
|
+
import type {WidgetPlacement} from '@deck.gl/core';
|
|
10
|
+
|
|
11
|
+
/** Properties for the ScreenshotWidget */
|
|
12
|
+
export type ScreenshotWidgetProps = WidgetImplProps & {
|
|
13
|
+
/** Widget positioning within the view. Default 'top-left'. */
|
|
14
|
+
placement?: WidgetPlacement;
|
|
15
|
+
/** Tooltip message */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** Filename to save to */
|
|
18
|
+
filename?: string;
|
|
19
|
+
/** Image format */
|
|
20
|
+
imageFormat?: 'image/png' | 'image/jpeg';
|
|
21
|
+
/** Callback, if defined user overrides the capture logic */
|
|
22
|
+
onCapture?: (widget: ScreenshotWidget) => void;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A button widget that captures a screenshot of the current canvas and downloads it as a (png) file.
|
|
27
|
+
* @note only captures canvas contents, not HTML DOM or CSS styles
|
|
28
|
+
*/
|
|
29
|
+
export class ScreenshotWidget extends WidgetImpl<ScreenshotWidgetProps> {
|
|
30
|
+
static defaultProps: Required<ScreenshotWidgetProps> = {
|
|
31
|
+
...WidgetImpl.defaultProps,
|
|
32
|
+
id: 'screenshot',
|
|
33
|
+
placement: 'top-left',
|
|
34
|
+
label: 'Screenshot',
|
|
35
|
+
filename: 'screenshot.png',
|
|
36
|
+
imageFormat: 'image/png',
|
|
37
|
+
onCapture: undefined!
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
className = 'deck-widget-screenshot';
|
|
41
|
+
placement: WidgetPlacement = 'top-left';
|
|
42
|
+
|
|
43
|
+
constructor(props: ScreenshotWidgetProps = {}) {
|
|
44
|
+
super({...ScreenshotWidget.defaultProps, ...props});
|
|
45
|
+
this.placement = props.placement ?? this.placement;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
setProps(props: Partial<ScreenshotWidgetProps>) {
|
|
49
|
+
this.placement = props.placement ?? this.placement;
|
|
50
|
+
super.setProps(props);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
onRenderHTML() {
|
|
54
|
+
const element = this.element;
|
|
55
|
+
if (!element) return;
|
|
56
|
+
render(
|
|
57
|
+
<IconButton
|
|
58
|
+
className="deck-widget-camera"
|
|
59
|
+
label={this.props.label}
|
|
60
|
+
onClick={this.handleClick.bind(this)}
|
|
61
|
+
/>,
|
|
62
|
+
element
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
handleClick() {
|
|
67
|
+
// Allow user to override the capture logic
|
|
68
|
+
if (this.props.onCapture) {
|
|
69
|
+
this.props.onCapture(this);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const dataURL = this.captureScreenToDataURL(this.props.imageFormat);
|
|
73
|
+
if (dataURL) {
|
|
74
|
+
this.downloadDataURL(dataURL, this.props.filename);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** @note only captures canvas contents, not HTML DOM or CSS styles */
|
|
79
|
+
captureScreenToDataURL(imageFormat: string): string | undefined {
|
|
80
|
+
const canvas = this.deck?.getCanvas();
|
|
81
|
+
return canvas?.toDataURL(imageFormat);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Download a data URL */
|
|
85
|
+
downloadDataURL(dataURL: string, filename: string): void {
|
|
86
|
+
const link = document.createElement('a');
|
|
87
|
+
link.href = dataURL;
|
|
88
|
+
link.download = filename;
|
|
89
|
+
link.click();
|
|
90
|
+
}
|
|
91
|
+
}
|
package/src/stylesheet.css
CHANGED
|
@@ -147,3 +147,15 @@
|
|
|
147
147
|
url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 26 26" fill="black"> wBox="0 0 26 26" fill="none"><path d="M7.89332 13.8866C7.64334 13.8866 7.43196 13.8 7.25918 13.6268C7.08639 13.4535 7 13.2416 7 12.9909C7 12.7403 7.08639 12.5291 7.25918 12.3575C7.43196 12.1858 7.64334 12.1 7.89332 12.1H18.099C18.349 12.1 18.5617 12.1866 18.737 12.3598C18.9123 12.5331 19 12.745 19 12.9957C19 13.2463 18.9123 13.4575 18.737 13.6291C18.5617 13.8008 18.349 13.8866 18.099 13.8866H7.89332Z"/></svg>')
|
|
148
148
|
);
|
|
149
149
|
}
|
|
150
|
+
|
|
151
|
+
/* Screenshot styles */
|
|
152
|
+
.deck-widget.deck-widget-screenshot button.deck-widget-camera .deck-widget-icon {
|
|
153
|
+
mask-image: var(
|
|
154
|
+
--icon-camera,
|
|
155
|
+
url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="black"><path d="M480-260q75 0 127.5-52.5T660-440q0-75-52.5-127.5T480-620q-75 0-127.5 52.5T300-440q0 75 52.5 127.5T480-260Zm0-80q-42 0-71-29t-29-71q0-42 29-71t71-29q42 0 71 29t29 71q0 42-29 71t-71 29ZM160-120q-33 0-56.5-23.5T80-200v-480q0-33 23.5-56.5T160-760h126l74-80h240l74 80h126q33 0 56.5 23.5T880-680v480q0 33-23.5 56.5T800-120H160Zm0-80h640v-480H638l-73-80H395l-73 80H160v480Zm320-240Z"/></svg>')
|
|
156
|
+
);
|
|
157
|
+
-webkit-mask-image: var(
|
|
158
|
+
--icon-camera,
|
|
159
|
+
url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="black"><path d="M480-260q75 0 127.5-52.5T660-440q0-75-52.5-127.5T480-620q-75 0-127.5 52.5T300-440q0 75 52.5 127.5T480-260Zm0-80q-42 0-71-29t-29-71q0-42 29-71t71-29q42 0 71 29t29 71q0 42-29 71t-71 29ZM160-120q-33 0-56.5-23.5T80-200v-480q0-33 23.5-56.5T160-760h126l74-80h240l74 80h126q33 0 56.5 23.5T880-680v480q0 33-23.5 56.5T800-120H160Zm0-80h640v-480H638l-73-80H395l-73 80H160v480Zm320-240Z"/></svg>')
|
|
160
|
+
);
|
|
161
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
/* global document */
|
|
6
|
+
import {_deepEqual, _applyStyles, _removeStyles} from '@deck.gl/core';
|
|
7
|
+
import type {Deck, Widget} from '@deck.gl/core';
|
|
8
|
+
|
|
9
|
+
export type WidgetImplProps = {
|
|
10
|
+
id?: string;
|
|
11
|
+
/** CSS inline style overrides. */
|
|
12
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
13
|
+
/** Additional CSS class. */
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
export abstract class WidgetImpl<PropsT extends WidgetImplProps> implements Widget<PropsT> {
|
|
17
|
+
id: string;
|
|
18
|
+
props: Required<PropsT>;
|
|
19
|
+
|
|
20
|
+
deck?: Deck<any>;
|
|
21
|
+
element?: HTMLDivElement;
|
|
22
|
+
|
|
23
|
+
static defaultProps: Required<WidgetImplProps> = {
|
|
24
|
+
id: 'widget',
|
|
25
|
+
style: {},
|
|
26
|
+
className: ''
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
abstract className: Required<string>;
|
|
30
|
+
|
|
31
|
+
constructor(props: Required<PropsT>) {
|
|
32
|
+
this.id = props.id || 'widget';
|
|
33
|
+
this.props = props;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
abstract onRenderHTML(): void;
|
|
37
|
+
|
|
38
|
+
onAdd({deck}: {deck: Deck<any>}): HTMLDivElement {
|
|
39
|
+
this.deck = deck;
|
|
40
|
+
const {style, className} = this.props;
|
|
41
|
+
const el = this._createRootElement({
|
|
42
|
+
widgetClassName: this.className,
|
|
43
|
+
className,
|
|
44
|
+
style
|
|
45
|
+
});
|
|
46
|
+
this.element = el;
|
|
47
|
+
this.onRenderHTML();
|
|
48
|
+
return this.element;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
onRemove() {
|
|
52
|
+
this.deck = undefined;
|
|
53
|
+
this.element = undefined;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
setProps(props: Partial<PropsT>) {
|
|
57
|
+
const oldProps = this.props;
|
|
58
|
+
const el = this.element;
|
|
59
|
+
if (el) {
|
|
60
|
+
if (oldProps.className !== props.className) {
|
|
61
|
+
if (oldProps.className) el.classList.remove(oldProps.className);
|
|
62
|
+
if (props.className) el.classList.add(props.className);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (!_deepEqual(oldProps.style, props.style, 1)) {
|
|
66
|
+
_removeStyles(el, oldProps.style);
|
|
67
|
+
_applyStyles(el, props.style);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
Object.assign(this.props, props);
|
|
72
|
+
this.onRenderHTML();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
_createRootElement(props: {
|
|
76
|
+
widgetClassName: string;
|
|
77
|
+
className?: string;
|
|
78
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
79
|
+
}) {
|
|
80
|
+
const {widgetClassName, className, style} = props;
|
|
81
|
+
const element = document.createElement('div');
|
|
82
|
+
['deck-widget', widgetClassName, className]
|
|
83
|
+
.filter((cls): cls is string => typeof cls === 'string' && cls.length > 0)
|
|
84
|
+
.forEach(className => element.classList.add(className));
|
|
85
|
+
_applyStyles(element, style);
|
|
86
|
+
return element;
|
|
87
|
+
}
|
|
88
|
+
}
|
package/src/zoom-widget.tsx
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
/* global document */
|
|
6
6
|
import {
|
|
7
7
|
FlyToInterpolator,
|
|
8
|
+
LinearInterpolator,
|
|
8
9
|
_deepEqual as deepEqual,
|
|
9
10
|
_applyStyles as applyStyles,
|
|
10
11
|
_removeStyles as removeStyles
|
|
@@ -36,7 +37,7 @@ export type ZoomWidgetProps = {
|
|
|
36
37
|
*/
|
|
37
38
|
zoomOutLabel?: string;
|
|
38
39
|
/**
|
|
39
|
-
* Zoom transition duration in ms.
|
|
40
|
+
* Zoom transition duration in ms. 0 disables the transition
|
|
40
41
|
*/
|
|
41
42
|
transitionDuration?: number;
|
|
42
43
|
/**
|
|
@@ -51,25 +52,33 @@ export type ZoomWidgetProps = {
|
|
|
51
52
|
|
|
52
53
|
export class ZoomWidget implements Widget<ZoomWidgetProps> {
|
|
53
54
|
id = 'zoom';
|
|
54
|
-
props: ZoomWidgetProps
|
|
55
|
+
props: Required<ZoomWidgetProps>;
|
|
55
56
|
placement: WidgetPlacement = 'top-left';
|
|
56
57
|
viewId?: string | null = null;
|
|
57
58
|
viewports: {[id: string]: Viewport} = {};
|
|
58
59
|
deck?: Deck<any>;
|
|
59
60
|
element?: HTMLDivElement;
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
static defaultProps: Required<ZoomWidgetProps> = {
|
|
63
|
+
id: 'zoom-widget',
|
|
64
|
+
style: {},
|
|
65
|
+
placement: 'top-left',
|
|
66
|
+
className: undefined!,
|
|
67
|
+
orientation: 'vertical',
|
|
68
|
+
transitionDuration: 200,
|
|
69
|
+
zoomInLabel: 'Zoom In',
|
|
70
|
+
zoomOutLabel: 'Zoom Out',
|
|
71
|
+
viewId: undefined!
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
constructor(props: ZoomWidgetProps = {}) {
|
|
62
75
|
this.id = props.id ?? this.id;
|
|
63
76
|
this.viewId = props.viewId ?? this.viewId;
|
|
64
77
|
this.placement = props.placement ?? this.placement;
|
|
65
78
|
|
|
66
79
|
this.props = {
|
|
67
|
-
...
|
|
68
|
-
|
|
69
|
-
transitionDuration: props.transitionDuration ?? 200,
|
|
70
|
-
zoomInLabel: props.zoomInLabel ?? 'Zoom In',
|
|
71
|
-
zoomOutLabel: props.zoomOutLabel ?? 'Zoom Out',
|
|
72
|
-
style: props.style ?? {}
|
|
80
|
+
...ZoomWidget.defaultProps,
|
|
81
|
+
...props
|
|
73
82
|
};
|
|
74
83
|
}
|
|
75
84
|
|
|
@@ -117,14 +126,16 @@ export class ZoomWidget implements Widget<ZoomWidgetProps> {
|
|
|
117
126
|
|
|
118
127
|
handleZoom(viewport: Viewport, nextZoom: number) {
|
|
119
128
|
const viewId = this.viewId || viewport?.id || 'default-view';
|
|
120
|
-
const nextViewState = {
|
|
129
|
+
const nextViewState: Record<string, unknown> = {
|
|
121
130
|
...viewport,
|
|
122
|
-
zoom: nextZoom
|
|
123
|
-
transitionDuration: this.props.transitionDuration,
|
|
124
|
-
transitionInterpolator: new FlyToInterpolator()
|
|
131
|
+
zoom: nextZoom
|
|
125
132
|
};
|
|
126
|
-
|
|
127
|
-
|
|
133
|
+
if (this.props.transitionDuration > 0) {
|
|
134
|
+
nextViewState.transitionDuration = this.props.transitionDuration;
|
|
135
|
+
nextViewState.transitionInterpolator =
|
|
136
|
+
'latitude' in nextViewState ? new FlyToInterpolator() : new LinearInterpolator();
|
|
137
|
+
}
|
|
138
|
+
this.setViewState(viewId, nextViewState);
|
|
128
139
|
}
|
|
129
140
|
|
|
130
141
|
handleZoomIn() {
|
|
@@ -139,6 +150,14 @@ export class ZoomWidget implements Widget<ZoomWidgetProps> {
|
|
|
139
150
|
}
|
|
140
151
|
}
|
|
141
152
|
|
|
153
|
+
/**
|
|
154
|
+
* @todo - move to deck or widget manager
|
|
155
|
+
*/
|
|
156
|
+
private setViewState(viewId: string, viewState: Record<string, unknown>): void {
|
|
157
|
+
// @ts-ignore Using private method temporary until there's a public one
|
|
158
|
+
this.deck._onViewStateChange({viewId, viewState, interactionState: {}});
|
|
159
|
+
}
|
|
160
|
+
|
|
142
161
|
private update() {
|
|
143
162
|
const element = this.element;
|
|
144
163
|
if (!element) {
|