How to use the @here/harp-lines/lib/Lines.LineGroup function in @here/harp-lines

To help you get started, we’ve selected a few @here/harp-lines examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heremaps / harp.gl / @here / harp-omv-datasource / lib / OmvDecodedTileEmitter.ts View on Github external
): void {
        const renderOrderOffset = evaluateTechniqueAttr(
            context,
            technique.renderOrderOffset,
            0
        );

        let lineGroup: LineGroup;
        const lineGroupGeometries = linesGeometry.find(aLine => {
            return (
                aLine.technique === techniqueIndex && aLine.renderOrderOffset === renderOrderOffset
            );
        });
        const hasNormalsAndUvs = uvs !== undefined;
        if (lineGroupGeometries === undefined) {
            lineGroup = new LineGroup(hasNormalsAndUvs, undefined, lineType === LineType.Simple);
            const aLine: LinesGeometry = {
                type: lineType === LineType.Complex ? GeometryType.SolidLine : GeometryType.Line,
                technique: techniqueIndex,
                renderOrderOffset:
                    renderOrderOffset !== undefined ? Number(renderOrderOffset) : undefined,
                lines: lineGroup
            };

            const techniqueTransient = evaluateTechniqueAttr(
                context,
                technique.transient,
                false
            );
            if (!techniqueTransient && this.m_gatherFeatureAttributes) {
                // if this technique is transient, do not save the featureIds with the geometry
                aLine.objInfos = [featureAttributes];
github heremaps / harp.gl / @here / harp-geojson-datasource / lib / GeoJsonGeometryCreator.ts View on Github external
private static createPolygonOutlineGeometry(
        geometryData: GeometryData,
        techniqueIndex: number,
        tileWorldExtents: number
    ): Geometry {
        const meshBuffer = new MeshBuffer();
        const { indices, featureStarts, geojsonProperties } = meshBuffer;

        let contour: number[];
        const holesVertices: number[][] = [];

        const solidOutline = new LineGroup();
        const position = new Array();

        for (const polygon of geometryData.polygons) {
            contour = polygon.holes.length
                ? polygon.vertices.slice(0, polygon.holes[0] * 3)
                : polygon.vertices;

            // External ring.
            this.addOutlineVertices(contour, tileWorldExtents, solidOutline, position);

            // Holes, if any.
            if (polygon.holes.length) {
                for (let i = 0; i < polygon.holes.length; i++) {
                    if (i === polygon.holes.length - 1) {
                        holesVertices[i] = polygon.vertices.slice(polygon.holes[i] * 3);
                    } else {
github heremaps / harp.gl / @here / harp-geojson-datasource / lib / GeoJsonGeometryCreator.ts View on Github external
private static createSolidLineGeometry(
        geometryData: GeometryData,
        techniqueIndex: number
    ): Geometry {
        const lineCenter = new THREE.Vector3();
        const lines = new LineGroup();
        const positions = new Array();

        for (const line of geometryData.lines.vertices) {
            lines.add(lineCenter, line);
            positions.push(...line);
        }

        return {
            type: GeometryType.SolidLine,
            index: {
                buffer: new Uint32Array(lines.indices).buffer,
                itemCount: 1,
                type: "uint32",
                name: "index"
            },
            interleavedVertexAttributes: [

@here/harp-lines

Create three.js geometries for wide lines

Apache-2.0
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Similar packages