+Because each polygon has a different number of vertices, when `data.attributes.getPolygon` is supplied, the layer also requires an array `data.startIndices` that describes the vertex index at the start of each polygon. For example, if there are 3 polygons of 5, 6, and 7 vertices each (including the end vertex that overlaps with the first vertex to close the loop), `startIndices` should be `[0, 5, 13, 20]`. When the polygon data contains holes, an additional array must be passed as `data.attributes.vertexValid`. This array must be a mask where all vertices are `1` except for the index of the last vertex of each polygon ring, which should be `0`. For instance, if the second polygon contains an outer ring with 3 vertices followed by an inner ring of 3 vertices then `vertexValid` should be passed as `[1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0]`. For reference see https://github.com/visgl/deck.gl/blob/master/modules/layers/src/geojson-layer/geojson-layer-props.ts#L107-L111.
0 commit comments