-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve public POI performance and allow offline usage #1169 - switch…
… to use geojson file for offline use and site regular use.
- Loading branch information
Showing
26 changed files
with
448 additions
and
463 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
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
22 changes: 22 additions & 0 deletions
22
IsraelHiking.Web/sources/application/components/sidebar/categories-group.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,22 @@ | ||
<mat-expansion-panel [expanded]="getExpandState()" (opened)="expand()" (closed)="collapse()"> | ||
<mat-expansion-panel-header> | ||
<button mat-button (click)="toggleVisibility()" angulartics2On="click" angularticsCategory="Layers" angularticsAction="Toggle visiblity of category layer {{categoriesGroup.type}}"> | ||
<i class="fa fa-lg" [ngClass]="{'icon-eye': categoriesGroup.visible, 'icon-eye-slash': !categoriesGroup.visible}"></i> | ||
</button> | ||
<p>{{resources.translate(categoriesGroup.type)}}</p> | ||
</mat-expansion-panel-header> | ||
<div *ngFor="let category of categoriesGroup.categories"> | ||
<div fxLayout="row" class="cursor-pointer row-hover" (click)="toggleCategory(category)" angulartics2On="click" angularticsCategory="Layers" angularticsAction="Toggle category visibility {{category.name}}"> | ||
<div fxFlex="10"></div> | ||
<div fxFlex="15"> | ||
<i class="fa" [ngClass]="{'icon-eye': category.visible, 'icon-eye-slash': !category.visible}"></i> | ||
</div> | ||
<div fxFlex="15"> | ||
<i class="fa" [ngClass]="category.icon" [style.color]="category.color"></i> | ||
</div> | ||
<div fxFlex> | ||
<span>{{resources.translate(category.name)}}</span> | ||
</div> | ||
</div> | ||
</div> | ||
</mat-expansion-panel> |
54 changes: 54 additions & 0 deletions
54
IsraelHiking.Web/sources/application/components/sidebar/categories-group.component.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,54 @@ | ||
import { Component, Input } from "@angular/core"; | ||
import { NgRedux } from "@angular-redux/store"; | ||
|
||
import { BaseMapComponent } from "../base-map.component"; | ||
import { ResourcesService } from "../../services/resources.service"; | ||
import { | ||
ExpandGroupAction, | ||
CollapseGroupAction, | ||
SetCategoryVisibilityAction, | ||
SetCategoriesGroupVisibilityAction | ||
} from "../../reducres/layers.reducer"; | ||
import { ApplicationState, CategoriesGroup, Category } from "../../models/models"; | ||
|
||
@Component({ | ||
selector: "categories-group", | ||
templateUrl: "./categories-group.component.html" | ||
}) | ||
export class CategoriesGroupComponent extends BaseMapComponent { | ||
|
||
@Input() | ||
public categoriesGroup: CategoriesGroup; | ||
|
||
constructor(resources: ResourcesService, | ||
private readonly ngRedux: NgRedux<ApplicationState>) { | ||
super(resources); | ||
} | ||
|
||
public expand() { | ||
this.ngRedux.dispatch(new ExpandGroupAction({ name: this.categoriesGroup.type })); | ||
} | ||
|
||
public collapse() { | ||
this.ngRedux.dispatch(new CollapseGroupAction({ name: this.categoriesGroup.type })); | ||
} | ||
|
||
public getExpandState(): boolean { | ||
return this.ngRedux.getState().layersState.expanded.find(l => l === this.categoriesGroup.type) != null; | ||
} | ||
|
||
public toggleCategory(category: Category) { | ||
this.ngRedux.dispatch(new SetCategoryVisibilityAction({ | ||
groupType: this.categoriesGroup.type, | ||
name: category.name, | ||
visible: !category.visible | ||
})); | ||
} | ||
|
||
public toggleVisibility() { | ||
this.ngRedux.dispatch(new SetCategoriesGroupVisibilityAction({ | ||
groupType: this.categoriesGroup.type, | ||
visible: !this.categoriesGroup.visible | ||
})); | ||
} | ||
} |
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.