How to use the @igo2/geo.FeatureMotion.Default function in @igo2/geo

To help you get started, we’ve selected a few @igo2/geo 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 / demo / src / app / geo / search / search.component.ts View on Github external
private tryAddFeatureToMap(layer: SearchResult) {
    if (layer.meta.dataType !== FEATURE) {
      return undefined;
    }

    // Somethimes features have no geometry. It happens with some GetFeatureInfo
    if (layer.data.geometry === undefined) {
      return;
    }

    this.map.overlay.setFeatures(
      [layer.data] as Feature[],
      FeatureMotion.Default
    );
  }
github infra-geo-ouverte / igo2-lib / packages / integration / src / lib / search / search-results-tool / search-results-tool.component.ts View on Github external
private tryAddFeatureToMap(result: SearchResult) {
    if (result.meta.dataType !== FEATURE) {
      return undefined;
    }
    const feature = (result as SearchResult).data;

    // Somethimes features have no geometry. It happens with some GetFeatureInfo
    if (feature.geometry === undefined) {
      return;
    }

    this.map.overlay.setFeatures([feature], FeatureMotion.Default);
  }
github infra-geo-ouverte / igo2-lib / demo / src / app / geo / feature / feature.component.ts View on Github external
ngOnInit() {
    const loadingStrategy = new FeatureStoreLoadingStrategy({});
    this.store.addStrategy(loadingStrategy);

    const selectionStrategy = new FeatureStoreSelectionStrategy({
      map: this.map,
      motion: FeatureMotion.Default
    });
    this.store.addStrategy(selectionStrategy);

    this.store.load([
      {
        meta: { id: 1 },
        type: 'Feature',
        geometry: {
          type: 'Point',
          coordinates: [-72, 47.8]
        },
        projection: 'EPSG:4326',
        properties: {
          id: 1,
          name: 'Name 1',
          description: 'Description 1'
github infra-geo-ouverte / igo2 / src / app / pages / portal / toast-panel / toast-panel.component.ts View on Github external
this.resultSelected$.next(result);
    const features = [];
    for (const feature of this.store.all()) {
      feature.data === this.resultSelected$.getValue().data ?
        feature.data.meta.style = this.getSelectedMarkerStyle(feature.data) :
          feature.data.meta.style = this.getMarkerStyle(feature.data);
      features.push(feature.data);
    }
    this.map.overlay.setFeatures(features, FeatureMotion.None);

    if (this.zoomAuto) {
      const olFeature = this.format.readFeature(this.resultSelected$.getValue().data, {
        dataProjection: this.resultSelected$.getValue().data.projection,
        featureProjection: this.map.projection
      });
      moveToOlFeatures(this.map, [olFeature], FeatureMotion.Default);
    }

    this.isResultSelected$.next(true);
    this.initialized = false;
  }