@deck.gl/geo-layers 9.1.12 → 9.2.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ import { AccessorFunction, DefaultProps } from '@deck.gl/core';
2
+ import GeoCellLayer, { GeoCellLayerProps } from "../geo-cell-layer/GeoCellLayer.js";
3
+ /** All properties supported by A5Layer. */
4
+ export type A5LayerProps<DataT = unknown> = _A5LayerProps<DataT> & GeoCellLayerProps<DataT>;
5
+ /** Properties added by A5Layer. */
6
+ type _A5LayerProps<DataT> = {
7
+ /**
8
+ * Called for each data object to retrieve the A5 pentagonal cell identifier.
9
+ *
10
+ * By default, it reads `pentagon` property of data object.
11
+ */
12
+ getPentagon?: AccessorFunction<DataT, string | bigint>;
13
+ };
14
+ /** Render filled and/or stroked polygons based on the [A5](https://a5geo.org) geospatial indexing system. */
15
+ export default class A5Layer<DataT = any, ExtraProps extends {} = {}> extends GeoCellLayer<DataT, Required<_A5LayerProps<DataT>> & ExtraProps> {
16
+ static layerName: string;
17
+ static defaultProps: DefaultProps<A5LayerProps<unknown>>;
18
+ indexToBounds(): Partial<GeoCellLayer['props']> | null;
19
+ }
20
+ export {};
21
+ //# sourceMappingURL=a5-layer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a5-layer.d.ts","sourceRoot":"","sources":["../../src/a5-layer/a5-layer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,gBAAgB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAC7D,OAAO,YAAY,EAAE,EAAC,iBAAiB,EAAC,0CAAuC;AAQ/E,2CAA2C;AAC3C,MAAM,MAAM,YAAY,CAAC,KAAK,GAAG,OAAO,IAAI,aAAa,CAAC,KAAK,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAE5F,mCAAmC;AACnC,KAAK,aAAa,CAAC,KAAK,IAAI;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CACxD,CAAC;AAEF,6GAA6G;AAC7G,MAAM,CAAC,OAAO,OAAO,OAAO,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,SAAS,EAAE,GAAG,EAAE,CAAE,SAAQ,YAAY,CACxF,KAAK,EACL,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,CAC5C;IACC,MAAM,CAAC,SAAS,SAAa;IAC7B,MAAM,CAAC,YAAY,sCAAgB;IAEnC,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI;CAkBvD"}
@@ -0,0 +1,31 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import GeoCellLayer from "../geo-cell-layer/GeoCellLayer.js";
5
+ import { cellToBoundary, hexToBigInt } from 'a5-js';
6
+ import { flattenPolygon } from "../h3-layers/h3-utils.js";
7
+ const defaultProps = {
8
+ getPentagon: { type: 'accessor', value: (d) => d.pentagon }
9
+ };
10
+ /** Render filled and/or stroked polygons based on the [A5](https://a5geo.org) geospatial indexing system. */
11
+ class A5Layer extends GeoCellLayer {
12
+ indexToBounds() {
13
+ const { data, getPentagon } = this.props;
14
+ return {
15
+ data,
16
+ _normalize: false,
17
+ _windingOrder: 'CCW',
18
+ positionFormat: 'XY',
19
+ getPolygon: (x, objectInfo) => {
20
+ const pentagon = getPentagon(x, objectInfo);
21
+ const boundary = cellToBoundary(typeof pentagon === 'string' ? hexToBigInt(pentagon) : pentagon);
22
+ boundary.push(boundary[0]);
23
+ return flattenPolygon(boundary);
24
+ }
25
+ };
26
+ }
27
+ }
28
+ A5Layer.layerName = 'A5Layer';
29
+ A5Layer.defaultProps = defaultProps;
30
+ export default A5Layer;
31
+ //# sourceMappingURL=a5-layer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a5-layer.js","sourceRoot":"","sources":["../../src/a5-layer/a5-layer.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,YAAiC,0CAAuC;AAC/E,OAAO,EAAC,cAAc,EAAE,WAAW,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,cAAc,EAAC,iCAA8B;AAErD,MAAM,YAAY,GAA+B;IAC/C,WAAW,EAAE,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAC;CAC/D,CAAC;AAeF,6GAA6G;AAC7G,MAAqB,OAAiD,SAAQ,YAG7E;IAIC,aAAa;QACX,MAAM,EAAC,IAAI,EAAE,WAAW,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QAEvC,OAAO;YACL,IAAI;YACJ,UAAU,EAAE,KAAK;YACjB,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE,CAAC,CAAQ,EAAE,UAAU,EAAE,EAAE;gBACnC,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;gBAC5C,MAAM,QAAQ,GAAG,cAAc,CAC7B,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAChE,CAAC;gBACF,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC3B,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAC;YAClC,CAAC;SACF,CAAC;IACJ,CAAC;;AApBM,iBAAS,GAAG,SAAS,CAAC;AACtB,oBAAY,GAAG,YAAY,CAAC;eALhB,OAAO"}