How to use the @terrestris/base-util/dist/Logger.error function in @terrestris/base-util

To help you get started, we’ve selected a few @terrestris/base-util 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 terrestris / react-geo / src / LayerTree / LayerTree.tsx View on Github external
setLayerVisibility(layer: OlLayerBase, visibility: boolean) {
    if (!(layer instanceof OlLayerBase) || !_isBoolean(visibility)) {
      Logger.error('setLayerVisibility called without layer or visiblity.');
      return;
    }
    if (layer instanceof OlLayerGroup) {
      layer.getLayers().forEach((subLayer) => {
        this.setLayerVisibility(subLayer, visibility);
      });
    } else {
      layer.setVisible(visibility);
    }
  }
github terrestris / react-geo / src / Field / NominatimSearch / NominatimSearch.tsx View on Github external
onFetchError(error: string) {
    Logger.error(`Error while requesting Nominatim: ${error}`);
  }
github terrestris / react-geo / src / Field / WfsSearchInput / WfsSearchInput.tsx View on Github external
onFetchError(error: string) {
    const {
      onFetchError
    } = this.props;
    Logger.error(`Error while requesting WFS GetFeature: ${error}`);
    this.setState({
      fetching: false
    }, () => {
      if (isFunction(onFetchError)) {
        onFetchError(error);
      }
    });
  }
github terrestris / ol-util / src / MapUtil / MapUtil.js View on Github external
static getLegendGraphicUrl(layer, extraParams) {
    if (!layer) {
      Logger.error('No layer passed to MapUtil.getLegendGraphicUrl.');
      return;
    }

    const source = layer.getSource();
    if (!(layer instanceof OlLayerBase) || !source) {
      Logger.error('Invalid layer passed to MapUtil.getLegendGraphicUrl.');
      return;
    }

    const isTiledWMS = source instanceof OlSourceTileWMS;
    const isImageWMS = source instanceof OlSourceImageWMS;

    if (isTiledWMS || isImageWMS) {
      const source = layer.getSource();
      const url = isTiledWMS ?
        source.getUrls() ? source.getUrls()[0] : ''
        : source.getUrl();
      const params = {
        LAYER: source.getParams().LAYERS,
        VERSION: '1.3.0',
        SERVICE: 'WMS',
        REQUEST: 'getLegendGraphic',
github terrestris / ol-util / src / MapUtil / MapUtil.js View on Github external
static getAllLayers(collection, filter = (() => true)) {
    if (!(collection instanceof OlMap) && !(collection instanceof OlLayerGroup)) {
      Logger.error('Input parameter collection must be from type `ol.Map`' +
        'or `ol.layer.Group`.');
      return [];
    }

    var layers = collection.getLayers().getArray();
    var allLayers = [];

    layers.forEach(function(layer) {
      if (layer instanceof OlLayerGroup) {
        MapUtil.getAllLayers(layer).forEach((layeri) => {
          if (filter(layeri)) {
            allLayers.push(layeri);
          }
        });
      }
      if (filter(layer)) {
github terrestris / react-geo / src / Field / WfsSearch / WfsSearch.tsx View on Github external
onFetchError(error: string) {
    Logger.error(`Error while requesting WFS GetFeature: ${error}`);
    this.setState({
      fetching: false
    });
  }
github terrestris / react-geo / src / Field / CoordinateReferenceSystemCombo / CoordinateReferenceSystemCombo.tsx View on Github external
onFetchError(error: string) {
    Logger.error(`Error while requesting in CoordinateReferenceSystemCombo: ${error}`);
  }