diff --git a/documentation/README.md b/documentation/README.md
index 7226e5b5..a03db96d 100644
--- a/documentation/README.md
+++ b/documentation/README.md
@@ -211,7 +211,7 @@ The `GeometryPolygonComponent` (`aol-geometry-polygon`) defines a polygon.
@@ -223,6 +223,72 @@ The `GeometryPolygonComponent` (`aol-geometry-polygon`) defines a polygon.
```
+### MultiPoint component
+
+The `GeometryMultiPointComponent` (`aol-geometry-multipoint`) defines a collection of points.
+
+#### MultiPoint component example
+
+```html
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+### MultiLinestring component
+
+The `GeometryMultiLinestringComponent` (`aol-geometry-multilinestring`) defines a collection of multilines.
+
+#### MultiLinestring component example
+
+```html
+
+
+
+
+
+
+
+
+
+```
+
+### MultiPolygon component
+
+The `GeometryMultiPolygonComponent` (`aol-geometry-multipolygon`) defines a collection polygons.
+
+#### MultiPolygon component example
+
+```html
+
+
+
+
+
+
+
+
+
+
+```
+
## Style components
`StyleComponents` (``) provide ways to altering the look of vector features.
diff --git a/projects/ngx-openlayers/src/lib/coordinate.component.ts b/projects/ngx-openlayers/src/lib/coordinate.component.ts
index 5a79ce32..8c8a6041 100644
--- a/projects/ngx-openlayers/src/lib/coordinate.component.ts
+++ b/projects/ngx-openlayers/src/lib/coordinate.component.ts
@@ -1,4 +1,4 @@
-import { Component, Optional, OnChanges, Input, SimpleChanges } from '@angular/core';
+import { Component, Optional, OnChanges, Input, SimpleChanges, OnInit } from '@angular/core';
import { Projection, transform } from 'ol/proj';
import { MapComponent } from './map.component';
import {
@@ -6,10 +6,14 @@ import {
GeometryLinestringComponent,
GeometryPolygonComponent,
GeometryCircleComponent,
-} from './geometry.components';
+ GeometryMultiPointComponent,
+ GeometryMultiLinestringComponent,
+ GeometryMultiPolygonComponent,
+} from './geom';
import { ViewComponent } from './view.component';
import { OverlayComponent } from './overlay.component';
import { Coordinate } from 'ol/coordinate';
+import { View } from 'ol';
@Component({
selector: 'aol-coordinate',
@@ -17,8 +21,9 @@ import { Coordinate } from 'ol/coordinate';
`,
})
-export class CoordinateComponent implements OnChanges {
+export class CoordinateComponent implements OnChanges, OnInit {
private host: any;
+ private mapSrid = 'EPSG:3857';
@Input()
x: number;
@@ -46,18 +51,31 @@ export class CoordinateComponent implements OnChanges {
}
}
+ ngOnInit() {
+ this.map.instance.on('change:view', e => this.onMapViewChanged(e));
+ this.mapSrid = this.map.instance
+ .getView()
+ .getProjection()
+ .getCode();
+ this.transformCoordinates();
+ }
+
ngOnChanges(changes: SimpleChanges) {
- let referenceProjection: Projection;
- let referenceProjectionCode: string;
- let transformedCoordinates: number[];
+ this.transformCoordinates();
+ }
- referenceProjection = this.map.instance.getView().getProjection();
- referenceProjectionCode = referenceProjection ? referenceProjection.getCode() : 'EPSG:3857';
+ private onMapViewChanged(event) {
+ this.mapSrid = (*View*/ any>(*BaseObject*/ any>event.target).get(event.key)).getProjection().getCode();
+ this.transformCoordinates();
+ }
- if (this.srid === referenceProjectionCode) {
+ private transformCoordinates() {
+ let transformedCoordinates: number[];
+
+ if (this.srid === this.mapSrid) {
transformedCoordinates = [this.x, this.y];
} else {
- transformedCoordinates = transform([this.x, this.y], this.srid, referenceProjectionCode);
+ transformedCoordinates = transform([this.x, this.y], this.srid, this.mapSrid);
}
switch (this.host.componentType) {
@@ -81,59 +99,82 @@ export class CoordinateComponent implements OnChanges {
`,
})
-export class CollectionCoordinatesComponent implements OnChanges {
+export class CollectionCoordinatesComponent implements OnChanges, OnInit {
private host: any;
+ private mapSrid = 'EPSG:3857';
@Input()
- coordinates: [number, number][];
+ coordinates: Coordinate[] | Coordinate[][] | Coordinate[][][];
@Input()
srid = 'EPSG:3857';
constructor(
private map: MapComponent,
@Optional() geometryLinestring: GeometryLinestringComponent,
- @Optional() geometryPolygon: GeometryPolygonComponent
+ @Optional() geometryPolygon: GeometryPolygonComponent,
+ @Optional() geometryMultipoint: GeometryMultiPointComponent,
+ @Optional() geometryMultilinestring: GeometryMultiLinestringComponent,
+ @Optional() geometryMultipolygon: GeometryMultiPolygonComponent
) {
// console.log('creating aol-collection-coordinates');
if (!!geometryLinestring) {
this.host = geometryLinestring;
} else if (!!geometryPolygon) {
this.host = geometryPolygon;
+ } else if (!!geometryMultipoint) {
+ this.host = geometryMultipoint;
+ } else if (!!geometryMultilinestring) {
+ this.host = geometryMultilinestring;
+ } else if (!!geometryMultipolygon) {
+ this.host = geometryMultipolygon;
} else {
throw new Error('aol-collection-coordinates must be a child of a geometry component');
}
}
+ ngOnInit() {
+ this.map.instance.on('change:view', e => this.onMapViewChanged(e));
+ this.mapSrid = this.map.instance
+ .getView()
+ .getProjection()
+ .getCode();
+ this.transformCoordinates();
+ }
+
ngOnChanges(changes: SimpleChanges) {
- let referenceProjection: Projection;
- let referenceProjectionCode: string;
- let transformedCoordinates: Array;
+ this.transformCoordinates();
+ }
- // console.log('coordinates change: ', this.coordinates);
+ private onMapViewChanged(event) {
+ this.mapSrid = (*View*/ any>(*BaseObject*/ any>event.target).get(event.key)).getProjection().getCode();
+ this.transformCoordinates();
+ }
- referenceProjection = this.map.instance.getView().getProjection();
- referenceProjectionCode = referenceProjection ? referenceProjection.getCode() : 'EPSG:3857';
+ private transformCoordinates() {
+ let transformedCoordinates: Coordinate[] | Coordinate[][] | Coordinate[][][];
- if (this.srid === referenceProjectionCode) {
+ if (this.srid === this.mapSrid) {
transformedCoordinates = this.coordinates;
} else {
- transformedCoordinates = [];
- this.coordinates.forEach(
- function(coordinate: Coordinate) {
- transformedCoordinates.push(transform(coordinate, this.srid, referenceProjectionCode));
- }.bind(this)
- );
- }
- switch (this.host.componentType) {
- case 'geometry-linestring':
- this.host.instance.setCoordinates(transformedCoordinates);
- break;
- case 'geometry-polygon':
- this.host.instance.setCoordinates([transformedCoordinates]);
- break;
- default:
- throw new Error('aol-collection-coordinates host is of unknown type: ' + this.host.componentType);
- // break;
+ switch (this.host.componentType) {
+ case 'geometry-linestring':
+ case 'geometry-multipoint':
+ transformedCoordinates = (this.coordinates).map(c => transform(c, this.srid, this.mapSrid));
+ break;
+ case 'geometry-polygon':
+ case 'geometry-multilinestring':
+ transformedCoordinates = (this.coordinates).map(cc =>
+ cc.map(c => transform(c, this.srid, this.mapSrid))
+ );
+ break;
+ case 'geometry-multipolygon':
+ transformedCoordinates = (this.coordinates).map(ccc =>
+ ccc.map(cc => cc.map(c => transform(c, this.srid, this.mapSrid)))
+ );
+ break;
+ }
}
+
+ this.host.instance.setCoordinates(transformedCoordinates);
}
}
diff --git a/projects/ngx-openlayers/src/lib/geom/geometrycircle.component.ts b/projects/ngx-openlayers/src/lib/geom/geometrycircle.component.ts
new file mode 100644
index 00000000..cc5031cb
--- /dev/null
+++ b/projects/ngx-openlayers/src/lib/geom/geometrycircle.component.ts
@@ -0,0 +1,30 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FeatureComponent } from '../feature.component';
+import { Circle } from 'ol/geom';
+import { SimpleGeometryComponent } from './simplegeometry.component';
+import { MapComponent } from '../map.component';
+
+@Component({
+ selector: 'aol-geometry-circle',
+ template: `
+
+ `,
+})
+export class GeometryCircleComponent extends SimpleGeometryComponent implements OnInit {
+ public componentType = 'geometry-circle';
+ public instance: Circle;
+
+ @Input()
+ get radius(): number {
+ return this.instance.getRadius();
+ }
+ set radius(radius: number) {
+ this.instance.setRadius(radius);
+ }
+
+ constructor(map: MapComponent, host: FeatureComponent) {
+ super(map, host);
+ // defaulting coordinates to [0,0]. To be overridden in child component.
+ this.instance = new Circle([0, 0]);
+ }
+}
diff --git a/projects/ngx-openlayers/src/lib/geom/geometrylinestring.component.ts b/projects/ngx-openlayers/src/lib/geom/geometrylinestring.component.ts
new file mode 100644
index 00000000..7313fc9c
--- /dev/null
+++ b/projects/ngx-openlayers/src/lib/geom/geometrylinestring.component.ts
@@ -0,0 +1,30 @@
+import { Component, OnDestroy, OnInit } from '@angular/core';
+import { FeatureComponent } from '../feature.component';
+import { SimpleGeometryComponent } from './simplegeometry.component';
+import { MapComponent } from '../map.component';
+import { LineString } from 'ol/geom';
+
+@Component({
+ selector: 'aol-geometry-linestring',
+ template: `
+
+ `,
+})
+export class GeometryLinestringComponent extends SimpleGeometryComponent implements OnInit, OnDestroy {
+ public componentType = 'geometry-linestring';
+ public instance: LineString;
+
+ constructor(map: MapComponent, host: FeatureComponent) {
+ super(map, host);
+ // console.log('instancing aol-geometry-linestring');
+ }
+
+ ngOnInit() {
+ this.instance = new LineString([[0, 0], [1, 1]]);
+ super.ngOnInit();
+ }
+
+ ngOnDestroy() {
+ super.ngOnDestroy();
+ }
+}
diff --git a/projects/ngx-openlayers/src/lib/geom/geometrymultilinestring.component.ts b/projects/ngx-openlayers/src/lib/geom/geometrymultilinestring.component.ts
new file mode 100644
index 00000000..3a3fed8d
--- /dev/null
+++ b/projects/ngx-openlayers/src/lib/geom/geometrymultilinestring.component.ts
@@ -0,0 +1,30 @@
+import { Component, OnDestroy, OnInit } from '@angular/core';
+import { FeatureComponent } from '../feature.component';
+import { SimpleGeometryComponent } from './simplegeometry.component';
+import { MapComponent } from '../map.component';
+import { MultiLineString } from 'ol/geom';
+
+@Component({
+ selector: 'aol-geometry-multilinestring',
+ template: `
+
+ `,
+})
+export class GeometryMultiLinestringComponent extends SimpleGeometryComponent implements OnInit, OnDestroy {
+ public componentType = 'geometry-multilinestring';
+ public instance: MultiLineString;
+
+ constructor(map: MapComponent, host: FeatureComponent) {
+ super(map, host);
+ // console.log('creating aol-geometry-multilinestring');
+ }
+
+ ngOnInit() {
+ this.instance = new MultiLineString([[[0, 0], [1, 1]]]);
+ super.ngOnInit();
+ }
+
+ ngOnDestroy() {
+ super.ngOnDestroy();
+ }
+}
diff --git a/projects/ngx-openlayers/src/lib/geom/geometrymultipoint.component.ts b/projects/ngx-openlayers/src/lib/geom/geometrymultipoint.component.ts
new file mode 100644
index 00000000..e9975792
--- /dev/null
+++ b/projects/ngx-openlayers/src/lib/geom/geometrymultipoint.component.ts
@@ -0,0 +1,30 @@
+import { Component, OnDestroy, OnInit } from '@angular/core';
+import { FeatureComponent } from '../feature.component';
+import { SimpleGeometryComponent } from './simplegeometry.component';
+import { MapComponent } from '../map.component';
+import { MultiPoint } from 'ol/geom';
+
+@Component({
+ selector: 'aol-geometry-multipoint',
+ template: `
+
+ `,
+})
+export class GeometryMultiPointComponent extends SimpleGeometryComponent implements OnInit, OnDestroy {
+ public componentType = 'geometry-multipoint';
+ public instance: MultiPoint;
+
+ constructor(map: MapComponent, host: FeatureComponent) {
+ super(map, host);
+ // console.log('creating aol-geometry-multipoint');
+ }
+
+ ngOnInit() {
+ this.instance = new MultiPoint([[0, 0], [1, 1]]);
+ super.ngOnInit();
+ }
+
+ ngOnDestroy() {
+ super.ngOnDestroy();
+ }
+}
diff --git a/projects/ngx-openlayers/src/lib/geom/geometrymultipolygon.component.ts b/projects/ngx-openlayers/src/lib/geom/geometrymultipolygon.component.ts
new file mode 100644
index 00000000..ff297a60
--- /dev/null
+++ b/projects/ngx-openlayers/src/lib/geom/geometrymultipolygon.component.ts
@@ -0,0 +1,30 @@
+import { Component, OnDestroy, OnInit } from '@angular/core';
+import { FeatureComponent } from '../feature.component';
+import { SimpleGeometryComponent } from './simplegeometry.component';
+import { MapComponent } from '../map.component';
+import { MultiPolygon } from 'ol/geom';
+
+@Component({
+ selector: 'aol-geometry-multipolygon',
+ template: `
+
+ `,
+})
+export class GeometryMultiPolygonComponent extends SimpleGeometryComponent implements OnInit, OnDestroy {
+ public componentType = 'geometry-multipolygon';
+ public instance: MultiPolygon;
+
+ constructor(map: MapComponent, host: FeatureComponent) {
+ super(map, host);
+ // console.log('creating aol-geometry-multipolygon');
+ }
+
+ ngOnInit() {
+ this.instance = new MultiPolygon([[[[0, 0], [1, 1], [0, 1]]]]);
+ super.ngOnInit();
+ }
+
+ ngOnDestroy() {
+ super.ngOnDestroy();
+ }
+}
diff --git a/projects/ngx-openlayers/src/lib/geom/geometrypoint.component.ts b/projects/ngx-openlayers/src/lib/geom/geometrypoint.component.ts
new file mode 100644
index 00000000..bef2d6a2
--- /dev/null
+++ b/projects/ngx-openlayers/src/lib/geom/geometrypoint.component.ts
@@ -0,0 +1,30 @@
+import { Component, OnDestroy, OnInit } from '@angular/core';
+import { FeatureComponent } from '../feature.component';
+import { SimpleGeometryComponent } from './simplegeometry.component';
+import { MapComponent } from '../map.component';
+import { Point } from 'ol/geom';
+
+@Component({
+ selector: 'aol-geometry-point',
+ template: `
+
+ `,
+})
+export class GeometryPointComponent extends SimpleGeometryComponent implements OnInit, OnDestroy {
+ public componentType = 'geometry-point';
+ public instance: Point;
+
+ constructor(map: MapComponent, host: FeatureComponent) {
+ super(map, host);
+ // console.log('creating aol-geometry-point');
+ }
+
+ ngOnInit() {
+ this.instance = new Point([0, 0]);
+ super.ngOnInit();
+ }
+
+ ngOnDestroy() {
+ super.ngOnDestroy();
+ }
+}
diff --git a/projects/ngx-openlayers/src/lib/geom/geometrypolygon.component.ts b/projects/ngx-openlayers/src/lib/geom/geometrypolygon.component.ts
new file mode 100644
index 00000000..7481a9d8
--- /dev/null
+++ b/projects/ngx-openlayers/src/lib/geom/geometrypolygon.component.ts
@@ -0,0 +1,30 @@
+import { Component, OnDestroy, OnInit } from '@angular/core';
+import { FeatureComponent } from '../feature.component';
+import { SimpleGeometryComponent } from './simplegeometry.component';
+import { MapComponent } from '../map.component';
+import { Polygon } from 'ol/geom';
+
+@Component({
+ selector: 'aol-geometry-polygon',
+ template: `
+
+ `,
+})
+export class GeometryPolygonComponent extends SimpleGeometryComponent implements OnInit, OnDestroy {
+ public componentType = 'geometry-polygon';
+ public instance: Polygon;
+
+ constructor(map: MapComponent, host: FeatureComponent) {
+ super(map, host);
+ // console.log('creating aol-geometry-polygon');
+ }
+
+ ngOnInit() {
+ this.instance = new Polygon([[[0, 0], [1, 1], [0, 1]]]);
+ super.ngOnInit();
+ }
+
+ ngOnDestroy() {
+ super.ngOnDestroy();
+ }
+}
diff --git a/projects/ngx-openlayers/src/lib/geom/index.ts b/projects/ngx-openlayers/src/lib/geom/index.ts
new file mode 100644
index 00000000..71297778
--- /dev/null
+++ b/projects/ngx-openlayers/src/lib/geom/index.ts
@@ -0,0 +1,7 @@
+export * from './geometrycircle.component';
+export * from './geometrylinestring.component';
+export * from './geometrymultilinestring.component';
+export * from './geometrymultipoint.component';
+export * from './geometrymultipolygon.component';
+export * from './geometrypoint.component';
+export * from './geometrypolygon.component';
diff --git a/projects/ngx-openlayers/src/lib/geom/simplegeometry.component.ts b/projects/ngx-openlayers/src/lib/geom/simplegeometry.component.ts
new file mode 100644
index 00000000..c7e8e853
--- /dev/null
+++ b/projects/ngx-openlayers/src/lib/geom/simplegeometry.component.ts
@@ -0,0 +1,21 @@
+import { Input, OnDestroy, OnInit } from '@angular/core';
+import { FeatureComponent } from '../feature.component';
+import { MapComponent } from '../map.component';
+import SimpleGeometry from 'ol/geom/SimpleGeometry';
+
+export abstract class SimpleGeometryComponent implements OnInit, OnDestroy {
+ public instance: SimpleGeometry;
+ public componentType = 'simple-geometry';
+
+ @Input() srid: string;
+
+ constructor(protected map: MapComponent, protected host: FeatureComponent) {}
+
+ ngOnInit() {
+ this.host.instance.setGeometry(this.instance);
+ }
+
+ ngOnDestroy() {
+ // this.host.instance.setGeometry(null);
+ }
+}
diff --git a/projects/ngx-openlayers/src/lib/geometry.components.ts b/projects/ngx-openlayers/src/lib/geometry.components.ts
deleted file mode 100644
index dc877271..00000000
--- a/projects/ngx-openlayers/src/lib/geometry.components.ts
+++ /dev/null
@@ -1,103 +0,0 @@
-import { Component, OnInit, OnDestroy, Input } from '@angular/core';
-import { Circle, LineString, Point, Polygon } from 'ol/geom';
-import { FeatureComponent } from './feature.component';
-
-@Component({
- selector: 'aol-geometry-linestring',
- template: `
-
- `,
-})
-export class GeometryLinestringComponent implements OnInit, OnDestroy {
- public componentType = 'geometry-linestring';
- public instance: LineString;
-
- constructor(private host: FeatureComponent) {
- // console.log('instancing aol-geometry-linestring');
- }
-
- ngOnInit() {
- this.instance = new LineString([]);
- this.host.instance.setGeometry(this.instance);
- }
- ngOnDestroy() {
- // this.host.setGeometry(null);
- }
-}
-
-@Component({
- selector: 'aol-geometry-point',
- template: `
-
- `,
-})
-export class GeometryPointComponent implements OnInit, OnDestroy {
- public componentType = 'geometry-point';
- public instance: Point;
-
- constructor(private host: FeatureComponent) {
- // console.log('creating aol-geometry-point');
- }
-
- ngOnInit() {
- this.instance = new Point([0, 0]); // defaulting coordinates to [0,0]. To be overridden in child component.
- this.host.instance.setGeometry(this.instance);
- }
-
- ngOnDestroy() {
- // this.host.setGeometry(null);
- }
-}
-
-@Component({
- selector: 'aol-geometry-polygon',
- template: `
-
- `,
-})
-export class GeometryPolygonComponent implements OnInit, OnDestroy {
- public componentType = 'geometry-polygon';
- public instance: Polygon;
-
- constructor(private host: FeatureComponent) {
- // console.log('creating aol-geometry-polygon');
- }
-
- ngOnInit() {
- // defaulting coordinates to [0,0]. To be overridden in child component.
- this.instance = new Polygon([[[0, 0], [1, 0], [1, 1]]]);
- this.host.instance.setGeometry(this.instance);
- }
-
- ngOnDestroy() {
- // this.host.setGeometry(null);
- }
-}
-
-@Component({
- selector: 'aol-geometry-circle',
- template: `
-
- `,
-})
-export class GeometryCircleComponent implements OnInit {
- public componentType = 'geometry-circle';
- public instance: Circle;
-
- @Input()
- get radius(): number {
- return this.instance.getRadius();
- }
- set radius(radius: number) {
- this.instance.setRadius(radius);
- }
-
- constructor(private host: FeatureComponent) {
- // defaulting coordinates to [0,0]. To be overridden in child component.
- this.instance = new Circle([0, 0]);
- }
-
- ngOnInit() {
- this.host.instance.setGeometry(this.instance);
- }
-}
diff --git a/projects/ngx-openlayers/src/public_api.ts b/projects/ngx-openlayers/src/public_api.ts
index b2e63d9e..88a5a826 100644
--- a/projects/ngx-openlayers/src/public_api.ts
+++ b/projects/ngx-openlayers/src/public_api.ts
@@ -27,11 +27,14 @@ import { SourceImageArcGISRestComponent } from './lib/sources/imagearcgisrest.co
import { SourceRasterComponent } from './lib/sources/raster.component';
import { FeatureComponent } from './lib/feature.component';
import {
+ GeometryCircleComponent,
GeometryLinestringComponent,
+ GeometryMultiLinestringComponent,
+ GeometryMultiPointComponent,
+ GeometryMultiPolygonComponent,
GeometryPointComponent,
GeometryPolygonComponent,
- GeometryCircleComponent,
-} from './lib/geometry.components';
+} from './lib/geom';
import { CollectionCoordinatesComponent, CoordinateComponent } from './lib/coordinate.component';
import { StyleComponent } from './lib/styles/style.component';
import { StyleCircleComponent } from './lib/styles/circle.component';
@@ -95,6 +98,9 @@ export {
SourceImageArcGISRestComponent,
FeatureComponent,
GeometryLinestringComponent,
+ GeometryMultiLinestringComponent,
+ GeometryMultiPointComponent,
+ GeometryMultiPolygonComponent,
GeometryPointComponent,
GeometryPolygonComponent,
GeometryCircleComponent,
@@ -166,6 +172,9 @@ const COMPONENTS = [
SourceRasterComponent,
FeatureComponent,
GeometryLinestringComponent,
+ GeometryMultiLinestringComponent,
+ GeometryMultiPointComponent,
+ GeometryMultiPolygonComponent,
GeometryPointComponent,
GeometryPolygonComponent,
GeometryCircleComponent,
diff --git a/src/app/cluster/cluster.component.ts b/src/app/cluster/cluster.component.ts
index 2a5882b4..6f318902 100644
--- a/src/app/cluster/cluster.component.ts
+++ b/src/app/cluster/cluster.component.ts
@@ -39,7 +39,7 @@ import { Component, OnInit } from '@angular/core';
diff --git a/src/app/color-select-hover/color-select-hover.component.ts b/src/app/color-select-hover/color-select-hover.component.ts
index 7ec67947..0dd37882 100644
--- a/src/app/color-select-hover/color-select-hover.component.ts
+++ b/src/app/color-select-hover/color-select-hover.component.ts
@@ -34,7 +34,7 @@ import { Feature } from 'ol';
diff --git a/src/app/display-geometry/display-geometry.component.ts b/src/app/display-geometry/display-geometry.component.ts
index 6a92db39..1a2a8e69 100644
--- a/src/app/display-geometry/display-geometry.component.ts
+++ b/src/app/display-geometry/display-geometry.component.ts
@@ -20,7 +20,7 @@ import { Component, OnInit } from '@angular/core';
-
+
@@ -70,6 +70,43 @@ import { Component, OnInit } from '@angular/core';
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -126,6 +163,38 @@ export class DisplayGeometryComponent implements OnInit {
radius: 50000,
},
},
+ {
+ type: 'Feature',
+ properties: {},
+ geometry: {
+ type: 'MultiPoint',
+ coordinates: [[0, 45], [0.5, 45], [1, 45]],
+ },
+ },
+ {
+ type: 'Feature',
+ properties: {},
+ geometry: {
+ type: 'MultiLineString',
+ coordinates: [
+ [[0, 44], [1, 44], [2, 44.5]],
+ [[0.5, 43.8], [1.5, 43.8], [2.5, 44.3]],
+ [[1, 43.6], [2, 43.6], [3, 44.1]],
+ ],
+ },
+ },
+ {
+ type: 'Feature',
+ properties: {},
+ geometry: {
+ type: 'MultiPolygon',
+ coordinates: [
+ [[[4, 45], [4.5, 44.5], [4, 44], [4, 45]]],
+ [[[5, 45], [5.5, 44.5], [5, 44], [5, 45]]],
+ [[[6, 45], [6.5, 44.5], [6, 44], [6, 45]]],
+ ],
+ },
+ },
];
ngOnInit() {}
diff --git a/src/app/draw-polygon/draw-polygon.component.ts b/src/app/draw-polygon/draw-polygon.component.ts
index 386c1a2f..26d3fd60 100644
--- a/src/app/draw-polygon/draw-polygon.component.ts
+++ b/src/app/draw-polygon/draw-polygon.component.ts
@@ -27,7 +27,7 @@ import { fromExtent } from 'ol/geom/Polygon';
-
+
@@ -86,5 +86,6 @@ export class DrawPolygonComponent implements OnInit {
coordinates: [olGeomPolygon.getCoordinates()[0]],
},
};
+ console.log(this.feature);
}
}
diff --git a/src/app/example-list.ts b/src/app/example-list.ts
index 0c1a209b..d91ec407 100644
--- a/src/app/example-list.ts
+++ b/src/app/example-list.ts
@@ -17,7 +17,8 @@ export const examplesList = [
},
{
title: 'Display geometry',
- description: 'Example of geojson features : point, polygon, linestring.',
+ description:
+ 'Example of geojson features : point, polygon, linestring, circle, multi-point, multi-linestring, multi-polygon.',
routerLink: 'display-geometry',
openLayersLink: 'https://openlayers.org/en/latest/examples/geojson.html',
},
diff --git a/src/app/modify-polygon/modify-polygon.component.ts b/src/app/modify-polygon/modify-polygon.component.ts
index a40e5119..ea95be49 100644
--- a/src/app/modify-polygon/modify-polygon.component.ts
+++ b/src/app/modify-polygon/modify-polygon.component.ts
@@ -26,7 +26,7 @@ import { GeoJSON } from 'ol/format';
-
+
diff --git a/src/app/overlay/overlay.component.ts b/src/app/overlay/overlay.component.ts
index 9a80df9c..5b265d32 100644
--- a/src/app/overlay/overlay.component.ts
+++ b/src/app/overlay/overlay.component.ts
@@ -21,7 +21,7 @@ import { fromExtent } from 'ol/geom/Polygon';