How to use the @here/harp-datasource-protocol/lib/Expr.Expr.isExpr function in @here/harp-datasource-protocol

To help you get started, we’ve selected a few @here/harp-datasource-protocol 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-mapview / lib / geometry / TileGeometryCreator.ts View on Github external
getPropertyValue(technique.color!, mapView.zoomLevel)
                                      );
                                  }
                                : undefined
                        );
                    }
                }

                this.addFeatureData(srcGeometry, technique, object);
                this.addGeometryObjInfos(tile, srcGeometry, technique, object);

                if (isExtrudedPolygonTechnique(technique) || isFillTechnique(technique)) {
                    // filled polygons are normal meshes, and need transparency only when fading or
                    // dynamic properties is defined.
                    const hasDynamicColor =
                        (technique.color !== undefined && Expr.isExpr(technique.color)) ||
                        (isExtrudedPolygonTechnique(technique) && Expr.isExpr(technique.emissive));
                    if (technique.fadeFar !== undefined || hasDynamicColor) {
                        const fadingParams = this.getFadingParams(displayZoomLevel, technique);
                        FadingFeature.addRenderHelper(
                            object,
                            viewRanges,
                            fadingParams.fadeNear,
                            fadingParams.fadeFar,
                            true,
                            hasDynamicColor
                                ? (renderer, mat) => {
                                      const polygonMaterial = mat as
                                          | MapMeshBasicMaterial
                                          | MapMeshStandardMaterial;

                                      polygonMaterial.color.set(
github heremaps / harp.gl / @here / harp-mapview / lib / geometry / TileGeometryCreator.ts View on Github external
if (isExtrudedLineTechnique(technique)) {
                    // extruded lines are normal meshes, and need transparency only when fading or
                    // dynamic properties is defined.
                    if (technique.fadeFar !== undefined || Expr.isExpr(technique.color)) {
                        const fadingParams = this.getFadingParams(
                            displayZoomLevel,
                            technique as StandardExtrudedLineTechnique
                        );

                        FadingFeature.addRenderHelper(
                            object,
                            viewRanges,
                            fadingParams.fadeNear,
                            fadingParams.fadeFar,
                            true,
                            technique.color !== undefined && Expr.isExpr(technique.color)
                                ? (renderer, mat) => {
                                      const extrudedMaterial = mat as
                                          | MapMeshStandardMaterial
                                          | MapMeshBasicMaterial;

                                      extrudedMaterial.color.set(
                                          getPropertyValue(technique.color!, mapView.zoomLevel)
                                      );
                                  }
                                : undefined
                        );
                    }
                }

                this.addFeatureData(srcGeometry, technique, object);
                this.addGeometryObjInfos(tile, srcGeometry, technique, object);
github heremaps / harp.gl / @here / harp-mapview / lib / geometry / TileGeometryCreator.ts View on Github external
);
                                  }
                                : undefined
                        );
                    }
                }

                this.addFeatureData(srcGeometry, technique, object);
                this.addGeometryObjInfos(tile, srcGeometry, technique, object);

                if (isExtrudedPolygonTechnique(technique) || isFillTechnique(technique)) {
                    // filled polygons are normal meshes, and need transparency only when fading or
                    // dynamic properties is defined.
                    const hasDynamicColor =
                        (technique.color !== undefined && Expr.isExpr(technique.color)) ||
                        (isExtrudedPolygonTechnique(technique) && Expr.isExpr(technique.emissive));
                    if (technique.fadeFar !== undefined || hasDynamicColor) {
                        const fadingParams = this.getFadingParams(displayZoomLevel, technique);
                        FadingFeature.addRenderHelper(
                            object,
                            viewRanges,
                            fadingParams.fadeNear,
                            fadingParams.fadeFar,
                            true,
                            hasDynamicColor
                                ? (renderer, mat) => {
                                      const polygonMaterial = mat as
                                          | MapMeshBasicMaterial
                                          | MapMeshStandardMaterial;

                                      polygonMaterial.color.set(
                                          getPropertyValue(technique.color!, mapView.zoomLevel)
github heremaps / harp.gl / @here / harp-mapview / lib / geometry / TileGeometryCreator.ts View on Github external
getPropertyValue(
                                        technique.gapSize,
                                        mapView.zoomLevel,
                                        mapView.pixelToWorld
                                    ) *
                                    unitFactor *
                                    0.5;
                            }
                        }
                    );
                }

                if (isExtrudedLineTechnique(technique)) {
                    // extruded lines are normal meshes, and need transparency only when fading or
                    // dynamic properties is defined.
                    if (technique.fadeFar !== undefined || Expr.isExpr(technique.color)) {
                        const fadingParams = this.getFadingParams(
                            displayZoomLevel,
                            technique as StandardExtrudedLineTechnique
                        );

                        FadingFeature.addRenderHelper(
                            object,
                            viewRanges,
                            fadingParams.fadeNear,
                            fadingParams.fadeFar,
                            true,
                            technique.color !== undefined && Expr.isExpr(technique.color)
                                ? (renderer, mat) => {
                                      const extrudedMaterial = mat as
                                          | MapMeshStandardMaterial
                                          | MapMeshBasicMaterial;
github heremaps / harp.gl / @here / harp-mapview / lib / RoadPicker.ts View on Github external
// tileInfo not of expected type [[ExtendedTileInfo]]
            return undefined;
        }

        const widths: RoadIntersectionData["widths"] = [];
        widths.length = lineFeatures.numFeatures;

        const mapView = this.m_mapView;
        for (let i = 0; i < lineFeatures.numFeatures; i++) {
            const technique = extendedTileInfo.techniqueCatalog[
                lineFeatures.techniqueIndex[i]
            ] as SolidLineTechnique;

            const isDynamic =
                technique.metricUnit === "Pixel" ||
                Expr.isExpr(technique.lineWidth) ||
                typeof technique.lineWidth === "string";

            widths[i] =
                technique.lineWidth !== undefined
                    ? isDynamic
                        ? () => {
                              const unitFactor =
                                  technique.metricUnit === "Pixel" ? mapView.pixelToWorld : 1.0;
                              return (
                                  getPropertyValue(
                                      technique.lineWidth,
                                      mapView.zoomLevel,
                                      mapView.pixelToWorld
                                  ) *
                                  unitFactor *
                                  0.5
github heremaps / harp.gl / @here / harp-mapview / lib / geometry / TileGeometryCreator.ts View on Github external
fadeFar: fadingParams.lineFadeFar
                    };
                    const edgeMaterial = new EdgeMaterial(materialParams);
                    const edgeObj = new THREE.LineSegments(edgeGeometry, edgeMaterial);

                    // Set the correct render order.
                    edgeObj.renderOrder = object.renderOrder + 0.1;

                    FadingFeature.addRenderHelper(
                        edgeObj,
                        viewRanges,
                        fadingParams.lineFadeNear,
                        fadingParams.lineFadeFar,
                        false,
                        extrudedPolygonTechnique.lineColor !== undefined &&
                            Expr.isExpr(extrudedPolygonTechnique.lineColor)
                            ? (renderer, mat) => {
                                  edgeMaterial.color.set(
                                      getPropertyValue(
                                          extrudedPolygonTechnique.lineColor!,
                                          mapView.zoomLevel
                                      )
                                  );
                              }
                            : undefined
                    );

                    if (extrusionAnimationEnabled) {
                        extrudedObjects.push({
                            object: edgeObj,
                            materialFeature: false
                        });