How to use the @igo2/utils.ObjectUtils.mergeDeep function in @igo2/utils

To help you get started, we’ve selected a few @igo2/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 infra-geo-ouverte / igo2-lib / packages / geo / src / lib / datasource / shared / datasources / wms-datasource.ts View on Github external
sourceParams.DPI = dpi;
    sourceParams.MAP_RESOLUTION = dpi;
    sourceParams.FORMAT_OPTIONS = 'dpi:' + dpi;

    if (options.refreshIntervalSec && options.refreshIntervalSec > 0) {
      setInterval(() => {
        this.refresh();
      }, options.refreshIntervalSec * 1000); // Convert seconds to MS
    }

    let fieldNameGeometry = defaultFieldNameGeometry;

    // ####   START if paramsWFS
    if (options.paramsWFS) {
      const wfsCheckup = checkWfsParams(options, 'wms');
      ObjectUtils.mergeDeep(options.paramsWFS, wfsCheckup.paramsWFS);

      fieldNameGeometry =
        options.paramsWFS.fieldNameGeometry || fieldNameGeometry;

      options.download = Object.assign({}, options.download, {
        dynamicUrl: this.buildDynamicDownloadUrlFromParamsWFS(options)
      });
    } //  ####   END  if paramsWFS

    if (!options.sourceFields || options.sourceFields.length === 0) {
      options.sourceFields = [];
    } else {
      options.sourceFields.forEach(sourceField => {
        sourceField.alias = sourceField.alias
          ? sourceField.alias
          : sourceField.name;
github infra-geo-ouverte / igo2-lib / packages / core / src / lib / language / shared / language.loader.ts View on Github external
map(translations => {
        return ObjectUtils.mergeDeep(translations[0], translations[1]);
      })
    );
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / datasource / shared / capabilities.service.ts View on Github external
minResolution:
          getResolutionFromScale(layer.MinScaleDenominator) || 0,
        metadata: {
          url: metadata ? metadata.OnlineResource : undefined,
          extern: metadata ? true : undefined,
          abstract,
          keywordList
        },
        legendOptions
      },
      queryable,
      timeFilter: timeFilterable ? timeFilter : undefined,
      timeFilterable: timeFilterable ? true : undefined
    });

    return ObjectUtils.mergeDeep(options, baseOptions);
  }
github infra-geo-ouverte / igo2-lib / projects / geo / src / lib / layer / shared / layer.service.ts View on Github external
createLayer(layerOptions: AnyLayerOptions): Layer {
    if (!layerOptions.source) {
      return;
    }

    if (
      layerOptions.source.options &&
      layerOptions.source.options.optionsFromCapabilities
    ) {
      layerOptions = ObjectUtils.mergeDeep(
        layerOptions,
        (layerOptions.source.options as any)._layerOptionsFromCapabilities
      );
    }

    let layer;
    switch (layerOptions.source.constructor) {
      case OSMDataSource:
      case WMTSDataSource:
      case XYZDataSource:
      case CartoDataSource:
      case TileArcGISRestDataSource:
        layer = this.createTileLayer(layerOptions as TileLayerOptions);
        break;
      case FeatureDataSource:
      case WFSDataSource:
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / datasource / shared / capabilities.service.ts View on Github external
const layers = [];
    const params = cartoOptions.layers[1].options.layer_definition;
    params.layers.forEach(element => {
      layers.push({
        type: element.type.toLowerCase(),
        options: element.options,
        legend: element.legend
      });
    });
    const options = ObjectUtils.removeUndefined({
      config: {
        version: params.version,
        layers
      }
    });
    return ObjectUtils.mergeDeep(options, baseOptions);
  }
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / layer / shared / layer.service.ts View on Github external
createLayer(layerOptions: AnyLayerOptions): Layer {
    if (!layerOptions.source) {
      return;
    }

    if (
      layerOptions.source.options &&
      layerOptions.source.options.optionsFromCapabilities
    ) {
      layerOptions = ObjectUtils.mergeDeep(
        (layerOptions.source.options as any)._layerOptionsFromCapabilities ||
          {},
        layerOptions || {}
      );
    }

    let layer;
    switch (layerOptions.source.constructor) {
      case OSMDataSource:
      case WMTSDataSource:
      case XYZDataSource:
      case CartoDataSource:
      case TileArcGISRestDataSource:
        layer = this.createTileLayer(layerOptions as TileLayerOptions);
        break;
      case FeatureDataSource:
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / datasource / shared / capabilities.service.ts View on Github external
};
    }
    const params = Object.assign(
      {},
      {
        legendInfo,
        style,
        timeFilter,
        timeExtent,
        attributions
      }
    );
    const options = ObjectUtils.removeUndefined({
      params
    });
    return ObjectUtils.mergeDeep(options, baseOptions);
  }