-
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.
- Loading branch information
Showing
42 changed files
with
5,506 additions
and
3,848 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Routes, RouterModule } from '@angular/router'; | ||
|
||
import { AppDrawComponent } from './draw.component'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: 'draw', | ||
component: AppDrawComponent | ||
} | ||
]; | ||
|
||
export const AppDrawRoutingModule = RouterModule.forChild( | ||
routes | ||
); |
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,18 @@ | ||
<mat-card> | ||
<mat-card-subtitle>Geo</mat-card-subtitle> | ||
<mat-card-title>Simple Map</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/draw">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-draw [store]="store" [map]="map"></igo-draw> | ||
|
||
</mat-card> |
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 @@ | ||
igo-map-browser { | ||
width: 100%; | ||
height: 300px; | ||
} | ||
|
||
igo-draw ::ng-deep mat-divider { | ||
position: inherit !important; | ||
left: inherit !important; | ||
width: 160px !important; | ||
} |
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,54 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
import { LanguageService } from '@igo2/core'; | ||
import { | ||
IgoMap, | ||
DataSourceService, | ||
LayerService, | ||
FeatureStore, | ||
FeatureWithDraw | ||
} from '@igo2/geo'; | ||
|
||
@Component({ | ||
selector: 'app-draw', | ||
templateUrl: './draw.component.html', | ||
styleUrls: ['./draw.component.scss'] | ||
}) | ||
export class AppDrawComponent { | ||
|
||
public map = new IgoMap({ | ||
controls: { | ||
attribution: { | ||
collapsed: true | ||
}, | ||
scaleLine: true | ||
} | ||
}); | ||
|
||
public view = { | ||
center: [-73, 47.2], | ||
zoom: 6, | ||
projection: 'EPSG:3857' | ||
}; | ||
|
||
public store = new FeatureStore<FeatureWithDraw>([], {map: this.map}); | ||
|
||
constructor( | ||
private languageService: LanguageService, | ||
private dataSourceService: DataSourceService, | ||
private layerService: LayerService | ||
) { | ||
this.dataSourceService | ||
.createAsyncDataSource({ | ||
type: 'osm' | ||
}) | ||
.subscribe(dataSource => { | ||
this.map.addLayer( | ||
this.layerService.createLayer({ | ||
title: 'OSM', | ||
source: dataSource | ||
}) | ||
); | ||
}); | ||
} | ||
} |
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,19 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { MatCardModule } from '@angular/material/card'; | ||
|
||
import { IgoMapModule, IgoDrawModule } from '@igo2/geo'; | ||
|
||
import { AppDrawComponent } from './draw.component'; | ||
import { AppDrawRoutingModule } from './draw-routing.module'; | ||
|
||
@NgModule({ | ||
declarations: [AppDrawComponent], | ||
imports: [ | ||
AppDrawRoutingModule, | ||
MatCardModule, | ||
IgoMapModule, | ||
IgoDrawModule | ||
], | ||
exports: [AppDrawComponent] | ||
}) | ||
export class AppDrawModule {} |
Oops, something went wrong.