-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
:feat(track feature): add possibility to track a feature (#422)
* feat(geo.layer.vector) add possibility to track a feature * fix(geo.layer.styleByAttribute) fix 0 value * feat(geo.layer.vector) possibility to track a feature on map * feat(geo.filter.trackfeature.button) add a good tooltip * feat(geo.layer) relocate button "trackFeature" * Update filter.module.ts * Update layer-item.component.html * Update vector-layer.interface.ts
- Loading branch information
1 parent
9c9fe31
commit 42fec9b
Showing
11 changed files
with
107 additions
and
8 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './track-feature-button.component'; |
10 changes: 10 additions & 0 deletions
10
packages/geo/src/lib/layer/track-feature-button/track-feature-button.component.html
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,10 @@ | ||
<button *ngIf="options.trackFeature" | ||
mat-icon-button | ||
collapsibleButton | ||
tooltip-position="below" | ||
matTooltipShowDelay="500" | ||
[matTooltip]="'igo.geo.layer.trackFeature' | translate" | ||
[color]="color" | ||
(click)="toggleTrackFeature()"> | ||
<mat-icon svgIcon="crosshairs-gps"></mat-icon> | ||
</button> |
Empty file.
43 changes: 43 additions & 0 deletions
43
packages/geo/src/lib/layer/track-feature-button/track-feature-button.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,43 @@ | ||
import { Component, Input, ChangeDetectionStrategy, OnInit } from '@angular/core'; | ||
|
||
import { Layer, VectorLayer } from '../shared/layers'; | ||
import { VectorLayerOptions } from '../shared/layers/vector-layer.interface'; | ||
|
||
@Component({ | ||
selector: 'igo-track-feature-button', | ||
templateUrl: './track-feature-button.component.html', | ||
styleUrls: ['./track-feature-button.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class TrackFeatureButtonComponent implements OnInit { | ||
|
||
@Input() layer: VectorLayer; | ||
|
||
@Input() trackFeature = false; | ||
|
||
get options(): VectorLayerOptions { | ||
if (!this.layer) { | ||
return; | ||
} | ||
return this.layer.options; | ||
} | ||
|
||
public color: string = 'primary'; | ||
|
||
constructor() {} | ||
|
||
ngOnInit() { | ||
this.color = this.trackFeature ? 'primary' : 'basic'; | ||
} | ||
|
||
toggleTrackFeature() { | ||
if (this.trackFeature) { | ||
this.layer.disableTrackFeature(this.layer.options.trackFeature); | ||
this.color = 'basic'; | ||
} else { | ||
this.layer.enableTrackFeature(this.layer.options.trackFeature); | ||
this.color = 'primary'; | ||
} | ||
this.trackFeature = !this.trackFeature; | ||
} | ||
} |
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