-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(import-export): better error handling
- Loading branch information
Showing
18 changed files
with
272 additions
and
25 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
15 changes: 15 additions & 0 deletions
15
demo/src/app/geo/import-export/import-export-routing.module.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,15 @@ | ||
import { Routes, RouterModule } from '@angular/router'; | ||
import { ModuleWithProviders } from '@angular/core'; | ||
|
||
import { AppImportExportComponent } from './import-export.component'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: 'import-export', | ||
component: AppImportExportComponent | ||
} | ||
]; | ||
|
||
export const AppImportExportRoutingModule: ModuleWithProviders = RouterModule.forChild( | ||
routes | ||
); |
20 changes: 20 additions & 0 deletions
20
demo/src/app/geo/import-export/import-export.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,20 @@ | ||
<mat-card> | ||
<mat-card-subtitle>Geo</mat-card-subtitle> | ||
<mat-card-title>Import / Export</mat-card-title> | ||
<mat-card-content> | ||
<li>Dependencies: LanguageService</li> | ||
|
||
<br> | ||
See the <a href="https://github.com/infra-geo-ouverte/igo2-lib/tree/master/demo/src/app/geo/import-export">code of this example</a> | ||
<hr> | ||
</mat-card-content> | ||
|
||
<igo-map-browser [map]="map" [view]="view"> | ||
<igo-zoom-button [map]="map" color="primary"></igo-zoom-button> | ||
</igo-map-browser> | ||
|
||
<igo-import-export [map]="map"></igo-import-export> | ||
|
||
</mat-card> | ||
|
||
<igo-message-center></igo-message-center> |
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,4 @@ | ||
igo-map-browser { | ||
width: 900px; | ||
height: 1000px; | ||
} |
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 } from '@angular/core'; | ||
|
||
import { LanguageService } from '@igo2/core'; | ||
import { IgoMap, LayerService } from '@igo2/geo'; | ||
|
||
@Component({ | ||
selector: 'app-import-export', | ||
templateUrl: './import-export.component.html', | ||
styleUrls: ['./import-export.component.scss'] | ||
}) | ||
export class AppImportExportComponent { | ||
public map = new IgoMap({ | ||
controls: { | ||
attribution: { | ||
collapsed: true | ||
} | ||
} | ||
}); | ||
|
||
public view = { | ||
center: [-73, 47.2], | ||
zoom: 9 | ||
}; | ||
|
||
constructor( | ||
private languageService: LanguageService, | ||
private layerService: LayerService | ||
) { | ||
this.layerService | ||
.createAsyncLayer({ | ||
title: 'Quebec Base Map', | ||
sourceOptions: { | ||
type: 'wmts', | ||
url: '/carto/wmts/1.0.0/wmts', | ||
layer: 'carte_gouv_qc_ro', | ||
matrixSet: 'EPSG_3857', | ||
version: '1.3.0' | ||
} | ||
}) | ||
.subscribe(l => this.map.addLayer(l)); | ||
|
||
} | ||
} |
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,22 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { MatCardModule, MatButtonModule } from '@angular/material'; | ||
|
||
import { IgoMessageModule } from '@igo2/core'; | ||
import { IgoMapModule, IgoImportExportModule } from '@igo2/geo'; | ||
|
||
import { AppImportExportComponent } from './import-export.component'; | ||
import { AppImportExportRoutingModule } from './import-export-routing.module'; | ||
|
||
@NgModule({ | ||
declarations: [AppImportExportComponent], | ||
imports: [ | ||
AppImportExportRoutingModule, | ||
MatCardModule, | ||
MatButtonModule, | ||
IgoMessageModule, | ||
IgoMapModule, | ||
IgoImportExportModule | ||
], | ||
exports: [AppImportExportComponent] | ||
}) | ||
export class AppImportExport {} |
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
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.