How to use the @here/harp-utils.LoggerManager.instance function in @here/harp-utils

To help you get started, we’ve selected a few @here/harp-utils 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
import { IOmvEmitter, OmvDecoder, Ring } from "./OmvDecoder";
import {
    tile2world,
    webMercatorTile2TargetTile,
    webMercatorTile2TargetWorld,
    world2tile
} from "./OmvUtils";

import {
    AttrEvaluationContext,
    evaluateTechniqueAttr
} from "@here/harp-datasource-protocol/lib/TechniqueAttr";
// tslint:disable-next-line:max-line-length
import { SphericalGeometrySubdivisionModifier } from "@here/harp-geometry/lib/SphericalGeometrySubdivisionModifier";

const logger = LoggerManager.instance.create("OmvDecodedTileEmitter");

const tempTileOrigin = new THREE.Vector3();
const tempVertOrigin = new THREE.Vector3();
const tempVertNormal = new THREE.Vector3();
const tempFootDisp = new THREE.Vector3();
const tempRoofDisp = new THREE.Vector3();

const tmpV2 = new THREE.Vector2();
const tmpV2r = new THREE.Vector2();
const tmpV3 = new THREE.Vector3();
const tmpV3r = new THREE.Vector3();

const tempP0 = new THREE.Vector2();
const tempP1 = new THREE.Vector2();
const tempPreviousTangent = new THREE.Vector2();
github heremaps / harp.gl / @here / harp-webtile-datasource / lib / WebTileDataSource.ts View on Github external
import * as THREE from "three";

// tslint:disable-next-line: max-line-length
import { SphericalGeometrySubdivisionModifier } from "@here/harp-geometry/lib/SphericalGeometrySubdivisionModifier";
import {
    GeoCoordinates,
    ProjectionType,
    TileKey,
    TilingScheme,
    webMercatorTilingScheme
} from "@here/harp-geoutils";
import { CopyrightInfo, DataSource, Tile, UrlCopyrightProvider } from "@here/harp-mapview";
import { getOptionValue, LoggerManager } from "@here/harp-utils";

const logger = LoggerManager.instance.create("MapView");

const textureLoader = new THREE.TextureLoader();
textureLoader.crossOrigin = ""; // empty assignment required to support CORS

/**
 * An interface for the rendering options that can be passed to the [[WebTileDataSource]].
 */
export interface WebTileRenderingOptions {
    /**
     * Opacity of the rendered images.
     * @default 1.0
     */
    opacity?: number;
}

/**
github heremaps / harp-map-editor / src / map-editor / TextEditor.tsx View on Github external
/*
 * Copyright (C) 2017-2019 HERE Europe B.V.
 * Licensed under Apache 2.0, see full license in LICENSE
 * SPDX-License-Identifier: Apache-2.0
 */
import { Theme } from "@here/harp-datasource-protocol";
import { LoggerManager } from "@here/harp-utils";
import * as React from "react";
import { Side, WindowCommands } from "../types";
import PopupsContainer from "./components-smart/PopupsContainer";
import MapHighlighter from "./map-handler/MapHighliter";
import settings from "./Settings";

export const logger = LoggerManager.instance.create("TextEditor");

/**
 * This class controls the monaco editor and communicate thru messages with the Theme editor.
 */
class TextEditor {
    readonly elemEditor = document.createElement("div");

    private m_frameURL: string;
    /**
     * Contains the child window when [[Side.DeTouch]] is selected
     */
    private m_editorWindow: Window | null = null;
    /**
     * Contains the child page when [[Side.DeTouch]] is not selected
     */
    private m_editorIframe: null | HTMLIFrameElement = null;
github heremaps / harp.gl / @here / harp-examples / src / xyz_show_space.ts View on Github external
* the desired space. To then update the data source, a small function is needed to parse the URL:
 * ```typescript
 * [[include:xyz_2.ts]]
 * ```
 *
 * Alternatively the XYZ Url can be passed via a query parameter passed to the page url:
 * Usage:
 * `?url=`
 *
 * Then the url Query Parameter will be parsed so it can be used to update the MapView:
 * ```typescript
 * [[include:xyz_3.ts]]
 * ```
 */

const logger = LoggerManager.instance.create("xyz-space");

export namespace XYZExample {
    document.body.innerHTML += `
        <style>
            #xyz-input-box{
                bottom: 0;
                position: relative;
                opacity: 0.8;
                box-sizing: border-box;
            }
            #xyz-input, #theme-input{
                font-family: Arial, sans-serif;
                font-size: 0.9em;
                padding: 9px 12px;
                outline: none;
                margin: 5px;</style>
github heremaps / harp.gl / @here / harp-mapview / lib / Statistics.ts View on Github external
/*
 * Copyright (C) 2017-2019 HERE Europe B.V.
 * Licensed under Apache 2.0, see full license in LICENSE
 * SPDX-License-Identifier: Apache-2.0
 */
import { LoggerManager, PerformanceTimer } from "@here/harp-utils";
import * as THREE from "three";

const logger = LoggerManager.instance.create("Statistics");

/**
 * A simple ring buffer to store the last `n` values of the timer. The buffer works on
 * a First-In-First-Out (FIFO) basis.
 */
export class RingBuffer {
    buffer: T[];
    size: number;
    head: number;
    tail: number;

    /**
     * Sets up the ring buffer.
     *
     * @param capacity The buffer's capacity.
     */
github heremaps / harp.gl / @here / harp-examples / lib / PerformanceUtils.ts View on Github external
MapViewEventNames,
    MapViewPowerPreference,
    MapViewUtils,
    PerformanceStatistics,
    RenderEvent,
    SimpleFrameStatistics
} from "@here/harp-mapview";
import { debugContext } from "@here/harp-mapview/lib/DebugContext";
import { APIFormat, OmvDataSource } from "@here/harp-omv-datasource";
import { assert, LoggerManager, PerformanceTimer } from "@here/harp-utils";
import * as THREE from "three";

import { accessToken } from "../config";
import { PerformanceTestData } from "./PerformanceConfig";

const logger = LoggerManager.instance.create("PerformanceUtils");

export namespace PerformanceUtils {
    export interface MapViewApp {
        mapView: MapView;
        mapControls: MapControls;
        omvDataSourceConnected: boolean;
        mainDataSource: OmvDataSource | undefined;
    }

    export interface ThemeDef {
        resource: string;
    }

    interface GlInfo {
        vendor: string;
        renderer: string;
github heremaps / harp.gl / @here / harp-mapview-decoder / lib / TileDecoderService.ts View on Github external
* Licensed under Apache 2.0, see full license in LICENSE
 * SPDX-License-Identifier: Apache-2.0
 */

import {
    addBuffersToTransferList,
    getProjection,
    ITileDecoder,
    WorkerDecoderProtocol
} from "@here/harp-datasource-protocol";
import { TileKey } from "@here/harp-geoutils";
import { LoggerManager } from "@here/harp-utils";

import { WorkerService, WorkerServiceResponse } from "./WorkerService";

const logger = LoggerManager.instance.create("TileDecoderService");

/**
 * An extension to [[WorkerService]], the `TileDecoderService` implements an asynchronous
 * (message based) service to decode tile content in web workers. The `TileDecoderService` itself
 * lives in the web worker, and communicates with messages by means of a [[ConcurrentWorkerSet]]
 * with the application.
 *
 * The `TileDecoderService` handles a [[DecodeTileRequest]], which contains a tile and its freshly
 * loaded binary data, decodes the content with the [[ITileDecoder]] that the service is configured
 * to use, and sends the data back in form of a [[WorkerServiceResponse]].
 */
export class TileDecoderService extends WorkerService {
    /**
     * Start a [[TileDecoderService]] with a given decoder.
     *
     * @param serviceId Service id. Must be unique.
github heremaps / harp.gl / @here / harp-mapview / lib / ConcurrentWorkerSet.ts View on Github external
* SPDX-License-Identifier: Apache-2.0
 */
import { RequestController, WorkerServiceProtocol } from "@here/harp-datasource-protocol";
import {
    getOptionValue,
    IWorkerChannelMessage,
    LoggerManager,
    LogLevel,
    WORKERCHANNEL_MSG_TYPE
} from "@here/harp-utils";

import { WorkerLoader } from "./workers/WorkerLoader";

import * as THREE from "three";

const logger = LoggerManager.instance.create("ConcurrentWorkerSet");

export function isLoggingMessage(message: IWorkerChannelMessage): message is IWorkerChannelMessage {
    return message &amp;&amp; typeof message.level === "number" &amp;&amp; message.type === WORKERCHANNEL_MSG_TYPE;
}

interface ReadyPromise {
    count: number;
    promise?: Promise;
    resolve: () =&gt; void;
    reject: (reason: any) =&gt; void;
    error?: any;
}

interface RequestEntry {
    promise: Promise;
    resolver: (error?: Error, response?: object) =&gt; void;
github heremaps / harp.gl / @here / harp-omv-datasource / lib / OmvDecoder.ts View on Github external
OmvGenericFeatureModifier
} from "./OmvDataFilter";
import { OmvDecodedTileEmitter } from "./OmvDecodedTileEmitter";
import {
    FeatureModifierId,
    OMV_TILE_DECODER_SERVICE_TYPE,
    OmvDecoderOptions,
    OmvFeatureFilterDescription
} from "./OmvDecoderDefs";
import { OmvTileInfoEmitter } from "./OmvTileInfoEmitter";
import { OmvTomTomFeatureModifier } from "./OmvTomTomFeatureModifier";
import { WorldTileProjectionCookie } from "./OmvUtils";
import { StyleSetDataFilter } from "./StyleSetDataFilter";
import { VTJsonDataAdapter } from "./VTJsonDataAdapter";

const logger = LoggerManager.instance.create("OmvDecoder", { enabled: false });

export class Ring {
    readonly winding: boolean;

    /**
     * Constructs a new [[Ring]].
     *
     * @param extents The extents of the enclosing layer.
     * @param vertexStride The stride of this elements stored in 'contour'.
     * @param contour The [[Array]] containing the projected world coordinates.
     */
    constructor(
        readonly extents: number,
        readonly vertexStride: number,
        readonly contour: number[]
    ) {
github heremaps / harp.gl / @here / harp-mapview / lib / DecodedTileHelpers.ts View on Github external
TextureProperties
} from "@here/harp-datasource-protocol";
import { Expr } from "@here/harp-datasource-protocol/lib/Expr";
import {
    CirclePointsMaterial,
    HighPrecisionLineMaterial,
    MapMeshBasicMaterial,
    MapMeshStandardMaterial,
    SolidLineMaterial
} from "@here/harp-materials";
import { LoggerManager } from "@here/harp-utils";
import * as THREE from "three";
import { Circles, Squares } from "./MapViewPoints";
import { toPixelFormat, toTextureDataType, toTextureFilter, toWrappingMode } from "./ThemeHelpers";

const logger = LoggerManager.instance.create("DecodedTileHelpers");

const DEFAULT_SKIP_PROPERTIES = [
    ...TEXTURE_PROPERTY_KEYS,
    "mapProperties",
    "normalMapProperties",
    "displacementMapProperties",
    "roughnessMapProperties",
    "emissiveMapProperties",
    "alphaMapProperties",
    "metalnessMapProperties",
    "bumpMapProperties"
];

/**
 * The structure of the options to pass into [[createMaterial]].
 */