Skip to content

Commit 1d058a0

Browse files
fix picking with binary geojson (visgl#6011)
1 parent 7bc510b commit 1d058a0

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

modules/layers/src/geojson-layer/geojson-binary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export function calculatePickingColors(geojsonBinary, encodePickingColor) {
8989
polygons: null
9090
};
9191
for (const key in pickingColors) {
92-
const featureIds = geojsonBinary[key].featureIds.value;
92+
const featureIds = geojsonBinary[key].globalFeatureIds.value;
9393
pickingColors[key] = new Uint8ClampedArray(featureIds.length * 3);
9494
const pickingColor = [];
9595
for (let i = 0; i < featureIds.length; i++) {

modules/layers/src/geojson-layer/geojson-layer-props.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,17 @@ export function createLayerPropsFromFeatures(features, featuresDiff) {
3838
return layerProps;
3939
}
4040

41-
export function createLayerPropsFromBinary(geojsonBinary, uniqueIdProperty, encodePickingColor) {
41+
export function createLayerPropsFromBinary(geojsonBinary, encodePickingColor) {
4242
const layerProps = createEmptyLayerProps();
4343
const {points, lines, polygons} = geojsonBinary;
4444

45-
const customPickingColors = calculatePickingColors(
46-
geojsonBinary,
47-
uniqueIdProperty,
48-
encodePickingColor
49-
);
45+
const customPickingColors = calculatePickingColors(geojsonBinary, encodePickingColor);
5046

5147
layerProps.points.data = {
5248
length: points.positions.value.length / points.positions.size,
5349
attributes: {
5450
getPosition: points.positions,
55-
pickingColors: {
51+
instancePickingColors: {
5652
size: 3,
5753
value: customPickingColors.points
5854
}
@@ -67,7 +63,7 @@ export function createLayerPropsFromBinary(geojsonBinary, uniqueIdProperty, enco
6763
startIndices: lines.pathIndices.value,
6864
attributes: {
6965
getPath: lines.positions,
70-
pickingColors: {
66+
instancePickingColors: {
7167
size: 3,
7268
value: customPickingColors.lines
7369
}

0 commit comments

Comments
 (0)