-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(geom): implements MultiPoint, MultiLinestring and MultiPolygon
- Loading branch information
1 parent
4d51a4f
commit 4e3954e
Showing
20 changed files
with
472 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
projects/ngx-openlayers/src/lib/geom/geometrycircle.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: ` | ||
<ng-content></ng-content> | ||
`, | ||
}) | ||
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]); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
projects/ngx-openlayers/src/lib/geom/geometrylinestring.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: ` | ||
<ng-content></ng-content> | ||
`, | ||
}) | ||
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(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
projects/ngx-openlayers/src/lib/geom/geometrymultilinestring.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: ` | ||
<ng-content></ng-content> | ||
`, | ||
}) | ||
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(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
projects/ngx-openlayers/src/lib/geom/geometrymultipoint.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: ` | ||
<ng-content></ng-content> | ||
`, | ||
}) | ||
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(); | ||
} | ||
} |
Oops, something went wrong.