-
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
40 changed files
with
606 additions
and
59 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,7 @@ | ||
export interface Poi { | ||
id?: string; | ||
title: string; | ||
x: number; | ||
y: number; | ||
zoom: number; | ||
} |
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 { Injectable } from '@angular/core'; | ||
import { Observable } from 'rxjs/Observable'; | ||
|
||
import { RequestService, ConfigService } from '../../../core'; | ||
import { AuthHttp } from '../../../auth'; | ||
import { Poi } from './poi.interface'; | ||
|
||
@Injectable() | ||
export class PoiService { | ||
|
||
private baseUrl: string; | ||
|
||
constructor(private authHttp: AuthHttp, | ||
private requestService: RequestService, | ||
private config: ConfigService) { | ||
|
||
this.baseUrl = this.config.getConfig('context.url'); | ||
} | ||
|
||
get(): Observable<Poi[]> { | ||
const url = this.baseUrl + '/pois'; | ||
const request = this.authHttp.get(url); | ||
return this.requestService.register(request, 'Get POIs error') | ||
.map((res) => { | ||
const pois: Poi[] = res.json(); | ||
return pois; | ||
}); | ||
} | ||
|
||
delete(id: string): Observable<void> { | ||
const url = this.baseUrl + '/pois/' + id; | ||
const request = this.authHttp.delete(url); | ||
return this.requestService.register(request, 'Delete POI error') | ||
.map((res) => { | ||
return res; | ||
}); | ||
} | ||
|
||
create(context: Poi): Observable<Poi> { | ||
const url = this.baseUrl + '/pois'; | ||
const request = this.authHttp.post(url, JSON.stringify(context)); | ||
return this.requestService.register(request, 'Create POI error') | ||
.map((res) => { | ||
return res.json(); | ||
}); | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
src/lib/map/bookmark/bookmark.component.html → ...ark-button/bookmark-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
30 changes: 30 additions & 0 deletions
30
src/lib/map/bookmark-button/bookmark-button.component.spec.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,30 @@ | ||
/* tslint:disable:no-unused-variable */ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { IgoSharedModule } from '../../shared'; | ||
|
||
import { BookmarkButtonComponent } from './bookmark-button.component'; | ||
|
||
describe('bookmarkButtonComponent', () => { | ||
let component: BookmarkButtonComponent; | ||
let fixture: ComponentFixture<BookmarkButtonComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
IgoSharedModule | ||
], | ||
declarations: [ BookmarkButtonComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(BookmarkButtonComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
2 changes: 1 addition & 1 deletion
2
src/lib/map/bookmark/bookmark.component.styl → ...ark-button/bookmark-button.component.styl
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/lib/map/bookmark/index.ts → src/lib/map/bookmark-button/index.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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './bookmark.component'; | ||
export * from './bookmark-button.component'; | ||
export * from './bookmark-dialog.component'; |
2 changes: 1 addition & 1 deletion
2
...ib/map/geolocate/geolocate.component.html → ...te-button/geolocate-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
30 changes: 30 additions & 0 deletions
30
src/lib/map/geolocate-button/geolocate-button.component.spec.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,30 @@ | ||
/* tslint:disable:no-unused-variable */ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { IgoSharedModule } from '../../shared'; | ||
|
||
import { GeolocateButtonComponent } from './geolocate-button.component'; | ||
|
||
describe('geolocateButtonComponent', () => { | ||
let component: GeolocateButtonComponent; | ||
let fixture: ComponentFixture<GeolocateButtonComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
IgoSharedModule | ||
], | ||
declarations: [ GeolocateButtonComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(GeolocateButtonComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
2 changes: 1 addition & 1 deletion
2
...ib/map/geolocate/geolocate.component.styl → ...te-button/geolocate-button.component.styl
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 './geolocate-button.component'; |
This file was deleted.
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
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,2 @@ | ||
export * from './poi-button.component'; | ||
export * from './poi-dialog.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<md-select placeholder="Zones of interest" floatPlaceholder="never" (change)="handlePoiChanged($event.value)"> | ||
<md-option> | ||
<div class="titlePoi">Create a new zone</div> | ||
<button igoStopPropagation class="addPoi buttonPoi" | ||
md-icon-button | ||
color="primary" | ||
(click)="createPoi()"> | ||
<md-icon> | ||
<span></span> | ||
</md-icon> | ||
</button> | ||
</md-option> | ||
<md-option *ngFor="let poi of pois" [value]="poi.id"> | ||
<div class="titlePoi">{{ poi.title }}</div> | ||
<button igoStopPropagation class="deletePoi buttonPoi" | ||
md-icon-button | ||
color="warn" | ||
(click)="deletePoi(poi)"> | ||
<md-icon> | ||
<span></span> | ||
</md-icon> | ||
</button> | ||
</md-option> | ||
</md-select> |
Oops, something went wrong.