mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +00:00
149 lines
4.2 KiB
HTML
149 lines
4.2 KiB
HTML
<!--
|
|
~ Copyright (C) 2022 StApps
|
|
~ This program is free software: you can redistribute it and/or modify it
|
|
~ under the terms of the GNU General Public License as published by the Free
|
|
~ Software Foundation, version 3.
|
|
~
|
|
~ This program is distributed in the hope that it will be useful, but WITHOUT
|
|
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
~ more details.
|
|
~
|
|
~ You should have received a copy of the GNU General Public License along with
|
|
~ this program. If not, see <https://www.gnu.org/licenses/>.
|
|
-->
|
|
|
|
<stapps-context contentId="map"></stapps-context>
|
|
|
|
<ion-header class="ion-no-border" translucent="true">
|
|
<ion-toolbar color="primary" mode="ios">
|
|
<ion-buttons slot="start">
|
|
<ion-back-button
|
|
*ngIf="items.length !== 1"
|
|
[defaultHref]="'..'"
|
|
[text]="'back' | translate | titlecase"
|
|
></ion-back-button>
|
|
<ion-back-button
|
|
*ngIf="items.length === 1"
|
|
[defaultHref]="'..'"
|
|
[text]="'back' | translate | titlecase"
|
|
(click)="resetView()"
|
|
></ion-back-button>
|
|
</ion-buttons>
|
|
<ion-title>{{ 'map.page.TITLE' | translate }}</ion-title>
|
|
</ion-toolbar>
|
|
<ion-toolbar color="primary">
|
|
<ion-searchbar
|
|
(keyup)="searchKeyUp($event)"
|
|
(keyup.enter)="hideKeyboard()"
|
|
[(ngModel)]="queryText"
|
|
(ionClear)="searchStringChanged()"
|
|
mode="md"
|
|
placeholder="{{ 'map.page.search_bar.placeholder' | translate }}"
|
|
showClearButton="always"
|
|
type="search"
|
|
enterkeyhint="search"
|
|
class="filterable"
|
|
>
|
|
<ion-menu-button menu="context" auto-hide="false">
|
|
<ion-icon name="adjustments"></ion-icon>
|
|
</ion-menu-button>
|
|
</ion-searchbar>
|
|
</ion-toolbar>
|
|
</ion-header>
|
|
|
|
<ion-content fullscreen id="map">
|
|
<div
|
|
class="map-container"
|
|
#mapContainer
|
|
leaflet
|
|
(leafletMapReady)="onMapReady($event)"
|
|
(leafletClick)="resetView()"
|
|
[leafletOptions]="options"
|
|
[leafletMarkerCluster]="markerClusterData"
|
|
[leafletMarkerClusterOptions]="markerClusterOptions"
|
|
>
|
|
<div *ngIf="position" [leafletLayer]="positionMarker"></div>
|
|
</div>
|
|
<div class="floating-content">
|
|
<div class="map-buttons above">
|
|
<ion-button
|
|
*ngIf="items.length > 1"
|
|
[@fadeInOut]
|
|
color="light"
|
|
shape="round"
|
|
size="small"
|
|
(click)="mapListModal.present()"
|
|
>
|
|
<ion-icon name="list"></ion-icon> {{
|
|
'map.page.buttons.SHOW_LIST' | translate
|
|
}}
|
|
</ion-button>
|
|
<ion-button
|
|
[disabled]="position === undefined"
|
|
color="light"
|
|
shape="round"
|
|
size="small"
|
|
(click)="onPositionClick()"
|
|
>
|
|
<ion-icon
|
|
*ngIf="position !== null; else questionIcon"
|
|
name="current-location"
|
|
></ion-icon>
|
|
<ng-template #questionIcon>
|
|
<ion-icon name="help"></ion-icon>
|
|
</ng-template>
|
|
</ion-button>
|
|
</div>
|
|
<stapps-map-item
|
|
*ngIf="items.length === 1"
|
|
[@fadeInOut]
|
|
[item]="items[0]"
|
|
(onClose)="resetView()"
|
|
></stapps-map-item>
|
|
</div>
|
|
<div class="map-buttons floating-buttons">
|
|
<ion-button
|
|
*ngIf="items.length > 1"
|
|
[@fadeInOut]
|
|
color="light"
|
|
shape="round"
|
|
size="small"
|
|
(click)="mapListModal.present()"
|
|
>
|
|
<ion-icon name="list"></ion-icon> {{
|
|
'map.page.buttons.SHOW_LIST' | translate
|
|
}}
|
|
</ion-button>
|
|
<ion-button
|
|
[disabled]="position === undefined"
|
|
color="light"
|
|
shape="round"
|
|
size="small"
|
|
(click)="onPositionClick()"
|
|
>
|
|
<ion-icon
|
|
*ngIf="position !== null; else questionIcon"
|
|
name="current-location"
|
|
></ion-icon>
|
|
<ng-template #questionIcon>
|
|
<ion-icon name="help"></ion-icon>
|
|
</ng-template>
|
|
</ion-button>
|
|
</div>
|
|
|
|
<ion-modal
|
|
[swipeToClose]="true"
|
|
[presentingElement]="routerOutlet.nativeEl"
|
|
#mapListModal
|
|
>
|
|
<ng-template>
|
|
<map-list-modal
|
|
style="height: 100%"
|
|
[filterQuery]="filterQuery"
|
|
[queryText]="queryText"
|
|
></map-list-modal>
|
|
</ng-template>
|
|
</ion-modal>
|
|
</ion-content>
|