-
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(routing): add routing on osrm (#166)
- Loading branch information
Showing
50 changed files
with
2,236 additions
and
60 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,15 @@ | ||
import { Routes, RouterModule } from '@angular/router'; | ||
import { ModuleWithProviders } from '@angular/core'; | ||
|
||
import { AppDirectionsComponent } from './directions.component'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: 'directions', | ||
component: AppDirectionsComponent | ||
} | ||
]; | ||
|
||
export const AppDirectionsRoutingModule: ModuleWithProviders = 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,19 @@ | ||
<mat-card> | ||
<mat-card-subtitle>Geo</mat-card-subtitle> | ||
<mat-card-title>Directions</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/directions">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-geolocate-button [map]="map" color="primary"></igo-geolocate-button> | ||
</igo-map-browser> | ||
|
||
<igo-routing-form [map]="map"></igo-routing-form> | ||
|
||
</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,4 @@ | ||
igo-map-browser { | ||
width: 800px; | ||
height: 300px; | ||
} |
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,42 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
import { LanguageService } from '@igo2/core'; | ||
import { IgoMap, LayerService } from '@igo2/geo'; | ||
|
||
@Component({ | ||
selector: 'app-directions', | ||
templateUrl: './directions.component.html', | ||
styleUrls: ['./directions.component.scss'] | ||
}) | ||
export class AppDirectionsComponent { | ||
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,27 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { MatCardModule, MatButtonModule } from '@angular/material'; | ||
|
||
import { IgoMessageModule } from '@igo2/core'; | ||
import { | ||
IgoMapModule, | ||
IgoRoutingModule, | ||
provideOsrmRoutingSource | ||
} from '@igo2/geo'; | ||
|
||
import { AppDirectionsComponent } from './directions.component'; | ||
import { AppDirectionsRoutingModule } from './directions-routing.module'; | ||
|
||
@NgModule({ | ||
declarations: [AppDirectionsComponent], | ||
imports: [ | ||
AppDirectionsRoutingModule, | ||
MatCardModule, | ||
MatButtonModule, | ||
IgoMessageModule, | ||
IgoMapModule, | ||
IgoRoutingModule | ||
], | ||
exports: [AppDirectionsComponent], | ||
providers: [provideOsrmRoutingSource()] | ||
}) | ||
export class AppDirectionsModule {} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,9 +1,10 @@ | ||
export interface RouteServiceOptions { | ||
centerKey?: boolean | string; | ||
zoomKey?: boolean | string; | ||
projectionKey?: boolean | string; | ||
contextKey?: boolean | string; | ||
searchKey?: boolean | string; | ||
visibleOnLayersKey?: boolean | string; | ||
visibleOffLayersKey?: boolean | string; | ||
centerKey?: boolean | string; | ||
zoomKey?: boolean | string; | ||
projectionKey?: boolean | string; | ||
contextKey?: boolean | string; | ||
searchKey?: boolean | string; | ||
visibleOnLayersKey?: boolean | string; | ||
visibleOffLayersKey?: boolean | string; | ||
routingCoordKey?: boolean | string; | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.