-
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.
refactor(map & feature): Refactor map and search results into map, fe… (
#2) * refactor(map & feature): Refactor map and search results into map, feature, layer, query and overlay modules
- Loading branch information
Showing
114 changed files
with
2,294 additions
and
322 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,8 @@ | ||
.igo-map-browser-container { | ||
width: 100%; | ||
height: 300px; | ||
} | ||
|
||
igo-zoom >>> button { | ||
background-color: #fff; | ||
} |
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.
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 +1 @@ | ||
export * from './core'; | ||
export * from './module'; |
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
lib/feature/feature-details/feature-details.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,12 @@ | ||
<table class="igo-striped"> | ||
<tbody> | ||
<tr *ngFor="let property of feature.properties | keyvalue"> | ||
<td> | ||
{{property.key}} | ||
</td> | ||
<td> | ||
{{property.value}} | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> |
38 changes: 38 additions & 0 deletions
38
lib/feature/feature-details/feature-details.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,38 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { IgoSharedModule } from '../../shared'; | ||
|
||
import { FeatureType, FeatureFormat } from '../shared'; | ||
import { FeatureDetailsComponent } from './feature-details.component'; | ||
|
||
describe('FeatureDetailsComponent', () => { | ||
let component: FeatureDetailsComponent; | ||
let fixture: ComponentFixture<FeatureDetailsComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
IgoSharedModule | ||
], | ||
declarations: [ FeatureDetailsComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(FeatureDetailsComponent); | ||
component = fixture.componentInstance; | ||
}); | ||
|
||
it('should create', () => { | ||
component.feature = { | ||
id: '1', | ||
type: FeatureType.Feature, | ||
format: FeatureFormat.GeoJSON, | ||
title: 'foo', | ||
icon: 'bar', | ||
source: 'foo' | ||
}; | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
lib/feature/feature-details/feature-details.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@require '../../styles.styl'; | ||
|
||
table { | ||
width: 100%; | ||
padding: $igo-padding; | ||
} | ||
|
||
table tbody tr td:first-child { | ||
font-weight: bold; | ||
} |
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,21 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
import { Feature } from '../shared/feature.interface'; | ||
|
||
@Component({ | ||
selector: 'igo-feature-details', | ||
templateUrl: './feature-details.component.html', | ||
styleUrls: ['./feature-details.component.styl'] | ||
}) | ||
export class FeatureDetailsComponent { | ||
|
||
@Input() | ||
get feature(): Feature { return this._feature; } | ||
set feature(value: Feature) { | ||
this._feature = value; | ||
} | ||
private _feature: Feature; | ||
|
||
constructor() { } | ||
|
||
} |
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,5 @@ | ||
<md-list-item> | ||
<md-icon md-list-avatar>{{feature.icon}}</md-icon> | ||
<h4 md-line *ngIf="feature.title_html" [innerHtml]="feature.title_html"></h4> | ||
<h4 md-line *ngIf="!feature.title_html">{{feature.title}}</h4> | ||
</md-list-item> |
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,38 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { IgoSharedModule } from '../../shared'; | ||
|
||
import { FeatureType, FeatureFormat } from '../shared'; | ||
import { FeatureItemComponent } from './feature-item.component'; | ||
|
||
describe('FeatureItemComponent', () => { | ||
let component: FeatureItemComponent; | ||
let fixture: ComponentFixture<FeatureItemComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
IgoSharedModule | ||
], | ||
declarations: [ FeatureItemComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(FeatureItemComponent); | ||
component = fixture.componentInstance; | ||
}); | ||
|
||
it('should create', () => { | ||
component.feature = { | ||
id: '1', | ||
type: FeatureType.Feature, | ||
format: FeatureFormat.GeoJSON, | ||
title: 'foo', | ||
icon: 'bar', | ||
source: 'foo' | ||
}; | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
File renamed without changes.
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 { Component, Input, ChangeDetectionStrategy } from '@angular/core'; | ||
|
||
import { Feature } from '../shared'; | ||
|
||
@Component({ | ||
selector: 'igo-feature-item', | ||
templateUrl: './feature-item.component.html', | ||
styleUrls: ['./feature-item.component.styl'], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class FeatureItemComponent { | ||
|
||
@Input() | ||
get feature(): Feature { return this._feature; } | ||
set feature(value: Feature) { | ||
this._feature = value; | ||
} | ||
private _feature: Feature; | ||
|
||
constructor() { } | ||
|
||
} |
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 './feature-item.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,18 @@ | ||
<igo-list [navigation]="true"> | ||
<template ngFor let-sourceFeature [ngForOf]="sourceFeatures"> | ||
<igo-collapsible title="{{sourceFeature[0]}} ({{sourceFeature[1].length}})"> | ||
<template ngFor let-feature [ngForOf]="sourceFeature[1]"> | ||
<igo-feature-item | ||
igoListItem | ||
color="primary" | ||
[feature]="feature" | ||
[focused]="featureService.focusedFeature$.value | ||
&& featureService.focusedFeature$.value.id === feature.id | ||
&& featureService.focusedFeature$.value.source === sourceFeature[0]" | ||
(focus)="featureService.focusFeature(feature)" | ||
(select)="featureService.selectFeature(feature)"> | ||
</igo-feature-item> | ||
</template> | ||
</igo-collapsible> | ||
</template> | ||
</igo-list> |
Oops, something went wrong.