How to use @igo2/geo - 10 common examples

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 / packages / integration / src / lib / map / map.state.ts View on Github external
constructor(
    private mapService: MapService,
    private projectionService: ProjectionService  // Don't remove this or it'll never be injected
  ) {
    this._map = new IgoMap({
      controls: {
        scaleLine: true,
        attribution: {
          collapsed: true
        }
      }
    });

    this.mapService.setMap(this.map);
  }
}
github infra-geo-ouverte / igo2-lib / demo / src / app / geo / ogc-filter / ogc-filter.component.ts View on Github external
featureTypes: 'vg_observation_v_autre_wmst',
        fieldNameGeometry: 'geometry',
        maxFeatures: 10000,
        version: '2.0.0',
        outputFormat: 'geojson',
        outputFormatDownload: 'SHP' // based on service capabilities
      },
      sourceFields: [
        { name: 'code_municipalite', alias: '# de la municipalitée' },
        { name: 'date_observation', excludeFromOgcFilters: true },
        { name: 'urgence', values: ['immédiate', 'inconnue'] }
      ],
      ogcFilters: {
        enabled: true,
        editable: true,
        allowedOperatorsType: OgcFilterOperatorType.All,
        filters: {
          logical: 'Or',
          filters: [
            {
              operator: 'PropertyIsEqualTo',
              propertyName: 'code_municipalite',
              expression: '10043'
            },
            {
              operator: 'Intersects',
              geometryName: 'the_geom',
              wkt_geometry: `MULTIPOLYGON(((
              -8379441.158019895 5844447.897707146,
              -8379441.158019895 5936172.331649357,
              -8134842.66750733 5936172.331649357,
              -8134842.66750733 5844447.897707146,
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-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]
        },
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,
github infra-geo-ouverte / igo2-lib / packages / context / src / lib / sidenav / sidenav.component.ts View on Github external
zoomToFeatureExtent() {
    if (this.feature.geometry) {
      const olFeature = this.format.readFeature(this.feature, {
        dataProjection: this.feature.projection,
        featureProjection: this.map.projection
      });
      moveToOlFeatures(this.map, [olFeature], FeatureMotion.Zoom);
    }
  }
github infra-geo-ouverte / igo2 / src / app / pages / portal / toast-panel / toast-panel.component.ts View on Github external
handler: () => {
          const olFeature = this.format.readFeature(this.resultSelected$.getValue().data, {
            dataProjection: this.resultSelected$.getValue().data.projection,
            featureProjection: this.map.projection
          });
          moveToOlFeatures(this.map, [olFeature], FeatureMotion.Zoom);
        }
      },
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;
  }