How to use the @igo2/utils.ObjectUtils.removeUndefined 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 / capabilities.service.ts View on Github external
private parseCartoOptions(
    baseOptions: CartoDataSourceOptions,
    cartoOptions: any
  ): CartoDataSourceOptions {
    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 / datasource / shared / capabilities.service.ts View on Github external
timeFilter = {
        min: min.toUTCString(),
        max: max.toUTCString(),
        range: true,
        type: TimeFilterType.DATETIME,
        style: TimeFilterStyle.CALENDAR
      };
    }
    const params = Object.assign(
      {},
      {
        layers: 'show:' + baseOptions.layer,
        time: timeExtent
      }
    );
    const options = ObjectUtils.removeUndefined({
      params,
      legendInfo,
      timeFilter,
      attributions
    });
    return ObjectUtils.mergeDeep(options, baseOptions);
  }
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / datasource / shared / capabilities.service.ts View on Github external
capabilities.Capability.Layer,
      layers
    );

    if (!layer) {
      return baseOptions;
    }
    const metadata = layer.DataURL ? layer.DataURL[0] : undefined;
    const abstract = layer.Abstract ? layer.Abstract : undefined;
    const keywordList = layer.KeywordList ? layer.KeywordList : undefined;
    const queryable = layer.queryable;
    const timeFilter = this.getTimeFilter(layer);
    const timeFilterable = timeFilter && Object.keys(timeFilter).length > 0;
    const legendOptions = layer.Style ? this.getStyle(layer.Style) : undefined;

    const options: WMSDataSourceOptions = ObjectUtils.removeUndefined({
      _layerOptionsFromCapabilities: {
        title: layer.Title,
        maxResolution:
          getResolutionFromScale(layer.MaxScaleDenominator) || Infinity,
        minResolution:
          getResolutionFromScale(layer.MinScaleDenominator) || 0,
        metadata: {
          url: metadata ? metadata.OnlineResource : undefined,
          extern: metadata ? true : undefined,
          abstract,
          keywordList
        },
        legendOptions
      },
      queryable,
      timeFilter: timeFilterable ? timeFilter : undefined,
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / datasource / shared / capabilities.service.ts View on Github external
range: true,
        type: TimeFilterType.DATETIME,
        style: TimeFilterStyle.CALENDAR
      };
    }
    const params = Object.assign(
      {},
      {
        legendInfo,
        style,
        timeFilter,
        timeExtent,
        attributions
      }
    );
    const options = ObjectUtils.removeUndefined({
      params
    });
    return ObjectUtils.mergeDeep(options, baseOptions);
  }