-
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(importExport): new export method by URL (based on download prope…
…rty) (#661) * fix(importExport)Skip while exportOptions undefined * refactor(importExport) typo * feat(import-export) formats is now a observable * feat(import export) Warning on no exportable layers available * feat(importExport) New export method bu URL (based on download property) * feat(import-export) manage downloadable format * refactor(locale) typo * feat(import-export)layer list is now observable * refactor(import-export) delay on url openning * refactor(import-export) clear the export format form if not contained in the format list * feat(import-export) try to preload features for not loaded layer/empty layers * feat(*) export button for exportable layers * feat(map) moving from download button to export button
- Loading branch information
Showing
17 changed files
with
241 additions
and
34 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
packages/geo/src/lib/import-export/export-button/export-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,11 @@ | ||
<button | ||
*ngIf="layerIsExportable()" | ||
mat-icon-button | ||
tooltip-position="below" | ||
matTooltipShowDelay="500" | ||
[matTooltip]="'igo.geo.download.action' | translate" | ||
[color]="color"> | ||
<!-- (click)="openDownload(layer)"> --> | ||
<mat-icon svgIcon="file-export"></mat-icon> | ||
</button> | ||
|
Empty file.
48 changes: 48 additions & 0 deletions
48
packages/geo/src/lib/import-export/export-button/export-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,48 @@ | ||
import { Component, Input, ChangeDetectionStrategy } from '@angular/core'; | ||
|
||
import { Layer } from '../../layer/shared/layers/layer'; | ||
|
||
import { LayerOptions, VectorLayer } from '../../layer'; | ||
|
||
@Component({ | ||
selector: 'igo-export-button', | ||
templateUrl: './export-button.component.html', | ||
styleUrls: ['./export-button.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class ExportButtonComponent { | ||
@Input() | ||
get layer(): Layer { | ||
return this._layer; | ||
} | ||
set layer(value: Layer) { | ||
this._layer = value; | ||
} | ||
private _layer: Layer; | ||
|
||
@Input() | ||
get color() { | ||
return this._color; | ||
} | ||
set color(value: string) { | ||
this._color = value; | ||
} | ||
private _color = 'primary'; | ||
|
||
constructor() {} | ||
|
||
get options(): LayerOptions { | ||
if (!this.layer) { | ||
return; | ||
} | ||
return this.layer.dataSource.options; | ||
} | ||
|
||
layerIsExportable(): boolean { | ||
if ((this.layer instanceof VectorLayer && this.layer.exportable === true) || | ||
(this.layer.dataSource.options.download && this.layer.dataSource.options.download.url)) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
} |
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 './export-button.component'; |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { strEnum } from '@igo2/utils'; | ||
|
||
export const ExportFormat = strEnum(['GeoJSON', 'GML', 'GPX', 'KML', 'Shapefile', 'CSV']); | ||
export const ExportFormat = strEnum(['GeoJSON', 'GML', 'GPX', 'KML', 'Shapefile', 'CSV', 'URL']); | ||
export type ExportFormat = keyof typeof ExportFormat; |
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
Oops, something went wrong.