@@ -501,7 +501,7 @@ import type {BinaryPointFeature} from '@loaders.gl/schema';
501
501
502
502
data .points = {
503
503
type: ' Point' ,
504
- positions: {value: Float32Array ([x0 , y0 , x1 , y1 , x2 , y2 , ... ]), size: 2 }, // Use size=2 for xy and size=3 for xyz
504
+ positions: {value: new Float32Array ([x0 , y0 , x1 , y1 , x2 , y2 , ... ]), size: 2 }, // Use size=2 for xy and size=3 for xyz
505
505
// featureIds
506
506
// globalFeatureIds
507
507
// numericProps
@@ -518,8 +518,8 @@ import type {BinaryLineFeature} from '@loaders.gl/schema';
518
518
519
519
data .lines = {
520
520
type: ' LineString' ,
521
- positions: {value: Float32Array ([x0 , y0 , x1 , y1 , x2 , y2 , ... ]), size: 2 }, // Use size=2 for xy and size=3 for xyz
522
- pathIndices: {value: Uint16Array ([0 , 5 , 7 , ... ]), size: 1 }, // First line contains vertex 0-4, second line contains vertex 5-6, ...
521
+ positions: {value: new Float32Array ([x0 , y0 , x1 , y1 , x2 , y2 , ... ]), size: 2 }, // Use size=2 for xy and size=3 for xyz
522
+ pathIndices: {value: new Uint16Array ([0 , 5 , 7 , ... ]), size: 1 }, // First line contains vertex 0-4, second line contains vertex 5-6, ...
523
523
// featureIds
524
524
// globalFeatureIds
525
525
// numericProps
@@ -535,9 +535,9 @@ Polygons are an extension of the idea introduced with lines, but instead of `pat
535
535
import type {BinaryPolygonFeature } from ' @loaders.gl/schema' ;
536
536
537
537
data .polygons = {
538
- positions: {value: Float32Array ([x0 , y0 , x1 , y1 , x2 , y2 , ... ]), size: 2 }, // Use size=2 for xy and size=3 for xyz
539
- polygonIndices: {value: Uint16Array ([0 , 100 , ... ]), size: 1 }, // First polygon contains vertex 0-99
540
- primitivePolygonIndices: {value: Uint16Array ([0 , 60 , 80 , 100 , ... ]), size: 1 }, // First polygon has 2 holes, made of vertex 60-79 and vertex 80-99
538
+ positions: {value: new Float32Array ([x0 , y0 , x1 , y1 , x2 , y2 , ... ]), size: 2 }, // Use size=2 for xy and size=3 for xyz
539
+ polygonIndices: {value: new Uint16Array ([0 , 100 , ... ]), size: 1 }, // First polygon contains vertex 0-99
540
+ primitivePolygonIndices: {value: new Uint16Array ([0 , 60 , 80 , 100 , ... ]), size: 1 }, // First polygon has 2 holes, made of vertex 60-79 and vertex 80-99
541
541
// featureIds
542
542
// globalFeatureIds
543
543
// numericProps
@@ -569,13 +569,13 @@ data.points = {
569
569
// featureIds
570
570
// globalFeatureIds
571
571
numericProps: {
572
- population: {value: Float32Array ([value0 , value1 , ... ], size : 1 }
572
+ population: {value: new Float32Array ([value0 , value1 , ... ]) , size: 1 }
573
573
},
574
574
// properties
575
575
} as BinaryPointFeature
576
576
```
577
577
578
- Both ` properties ` and ` numericProps ` are specified per-feature .
578
+ Both ` properties ` and ` numericProps ` are specified per-vertex .
579
579
580
580
#### Feature IDs and global feature IDs
581
581
@@ -629,13 +629,13 @@ const geojson: FeatureCollection = {
629
629
const binary: BinaryPointFeature = {
630
630
shape: ' binary-feature-collection' ,
631
631
points: {
632
- positions: {value: Float32Array ([1 ,23 , 4.56 ]), size: 2 },
632
+ positions: {value: new Float32Array ([1 ,23 , 4.56 ]), size: 2 },
633
633
properties: [{name: ' London' }],
634
634
numericProps: {
635
- population: {value: Float32Array ([10000000 ], size : 1 }
635
+ population: {value: new Float32Array ([10000000 ]) , size: 1 }
636
636
},
637
- featureIds : {value: Uint16Array ([0 ]), size: 1 },
638
- globalFeatureIds : {value: Uint16Array ([0 ]), size: 1 },
637
+ featureIds: {value: new Uint16Array ([0 ]), size: 1 },
638
+ globalFeatureIds: {value: new Uint16Array ([0 ]), size: 1 },
639
639
fields: [{id: 123 }]
640
640
}
641
641
};
0 commit comments