Skip to content

Commit a3ae3ee

Browse files
committed
fix after merge
Signed-off-by: Ihor Dykhta <[email protected]>
1 parent 476ee89 commit a3ae3ee

File tree

1 file changed

+6
-29
lines changed

1 file changed

+6
-29
lines changed

src/layers/src/arc-layer/arc-layer.ts

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Copyright contributors to the kepler.gl project
33

44
import * as arrow from 'apache-arrow';
5-
import {h3ToGeo} from 'h3-js';
65

76
import Layer, {
87
LayerBaseConfig,
@@ -16,7 +15,12 @@ import {GeoArrowArcLayer} from '@kepler.gl/deckgl-arrow-layers';
1615
import {FilterArrowExtension} from '@kepler.gl/deckgl-layers';
1716
import {ArcLayer as DeckArcLayer} from '@deck.gl/layers';
1817

19-
import {hexToRgb, DataContainerInterface, ArrowDataContainer} from '@kepler.gl/utils';
18+
import {
19+
hexToRgb,
20+
DataContainerInterface,
21+
maybeHexToGeo,
22+
ArrowDataContainer
23+
} from '@kepler.gl/utils';
2024
import ArcLayerIcon from './arc-layer-icon';
2125
import {isLayerHoveredFromArrow, createGeoArrowPointVector, getFilteredIndex} from '../layer-utils';
2226
import {
@@ -140,33 +144,6 @@ const DEFAULT_COLUMN_MODE = COLUMN_MODE_POINTS;
140144
const brushingExtension = new BrushingExtension();
141145
const arrowCPUFilterExtension = new FilterArrowExtension();
142146

143-
export function getPositionFromHexValue(token) {
144-
const pos = h3ToGeo(token);
145-
146-
if (Array.isArray(pos) && pos.every(Number.isFinite)) {
147-
return [pos[1], pos[0]];
148-
}
149-
return null;
150-
}
151-
152-
function maybeHexToGeo(
153-
dc: DataContainerInterface,
154-
d: {index: number},
155-
lat: LayerColumn,
156-
lng: LayerColumn
157-
) {
158-
// lat or lng column could be hex column
159-
// we assume string value is hex and try to convert it to geo lat lng
160-
const latVal = dc.valueAt(d.index, lat.fieldIdx);
161-
const lngVal = dc.valueAt(d.index, lng.fieldIdx);
162-
163-
return typeof latVal === 'string'
164-
? getPositionFromHexValue(latVal)
165-
: typeof lngVal === 'string'
166-
? getPositionFromHexValue(lngVal)
167-
: null;
168-
}
169-
170147
function isH3Field(columns, allFields, key) {
171148
const field = allFields[columns[key].fieldIdx];
172149
return field?.type === ALL_FIELD_TYPES.h3;

0 commit comments

Comments
 (0)