Skip to content

Commit

Permalink
Revert "Direction tool fix (#673)"
Browse files Browse the repository at this point in the history
This reverts commit d0b3ba8.
  • Loading branch information
pelord authored Oct 12, 2021
1 parent d0b3ba8 commit cb00521
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 221 deletions.
12 changes: 0 additions & 12 deletions docs/_tables/fr/properties/filter/igoOgcFilterDuring.csv

This file was deleted.

12 changes: 4 additions & 8 deletions docs/_tables/fr/properties/filter/igoogcfilterduringoptions.csv
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
Propriétés,Type,Description,Valeurs possibles,Valeur défaut
begin ,String ,Valeur de début du filtre temporel ,,Valeur **minDate** de la couche
end ,String ,Valeur de fin du filtre temporel ,,Valeur **maxDate** de la couche
step ,String ,Pas de temps défini selon la norme ISO-8601 ,Voir `wiki <https://fr.wikipedia.org/wiki/ISO_8601#Dur%C3%A9e>`__ ,60000 millisecondes
begin ,String ,Valeur de début du filtre temporel ,,Valeur **minDate** de la couche
end ,String ,Valeur de fin du filtre temporel ,,Valeur **maxDate** de la couche
step ,String ,Pas de temps défini selon la norme ISO-8601 ,Voir `wiki <https://fr.wikipedia.org/wiki/ISO_8601#Dur%C3%A9e>`__ ,60000 millisecondes
restrictedToStep ,Boolean,"| True si le filtre doit respecter le pas de temps depuis
| l'attribut **minDate**.
|
| Sinon le pas de temps est respecté selon l'attribut **begin**",True | False ,False
calendarModeYearBoolean,,"Lorsque true, l’interface présentera uniquement des
| années et ajustera les requête aux service pour
| que l’année de début et de fin soit incluse dans
| le retour.",True | False ,False
| Sinon le pas de temps est respecté selon l'attribut **begin**",True | False ,False
67 changes: 0 additions & 67 deletions docs/properties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -736,56 +736,6 @@ Liens
- `OGC WMS <https://www.opengeospatial.org/standards/wms>`__


WMS avec WFS combinés
======================


.. note::

Disponible actuellement mais la documentation est en cours de construction.

.. line-block::

Il est possible de combiner un wms et à partir d'une certaine échelle d'apeller la couche en WFS si le service web offre les 2 options.

** Attention le champ ID du service doit être bien définie car ce sera ce champ qui servira a reconnaitre chaque entitée WFS, par exemple dans
la table attributaire. Si le champ id n'est pas bien définie dans le service ou que vous configurez une sortie dans un type ou ID n'est
pas présent au 1er niveau de l'objet dans le retour du service (geojson, GML, etc), vous pourez avoir des problèmes d'entitées qui sont dédoublées.


Exemples

.. code:: json
{"title": "WMS with underlying WFS params",
"visible": true,
"maxResolution": 1200,
"workspace": {
"enabled": true,
"maxResolution": 100
},
"sourceOptions": {
"queryable": true,
"queryTitle": "nometablis",
"type": "wms",
"url": "https://ws.mapserver.transports.gouv.qc.ca/swtq",
"urlWfs": "https://ws.mapserver.transports.gouv.qc.ca/swtq",
"params": {
"layers": "etablissement_mtq"
},
"paramsWFS": {
"featureTypes": "etablissement_mtq",
"fieldNameGeometry": "geometry",
"maxFeatures": 5000
},
"ogcFilters": {
"enabled": true,
"editable": true
}
}
}
WMTS
===============

Expand Down Expand Up @@ -1122,22 +1072,6 @@ Exemple - Filtre temporel avec minimum, maximum et pas de temps.
"stepDate": "P1D"
}
Exemple - filtre temporel en mode année

.. code:: json
{
"filters" :{
"operator": "During",
"propertyName": "annee_date",
"begin": "1890-01-01T00:00:00-05:00",
"end": "2021-12-31T00:00:00-05:00",
"restrictedToStep": false,
"calendarModeYear": true
}
"stepDate": "P1Y"
}
Exemple - filtre avec boutons spécifique à un groupe et calendrier (filtrage temporel)

.. code:: json
Expand Down Expand Up @@ -1293,7 +1227,6 @@ Propriétés de l'objet filters (IgoLogicalArrayOptions|AnyBaseOgcFilterOptions)

.. _igoogcfilterduringoptions:


Propriétés de l'objet filter de type **During**

.. tabularcolumns:: |p{1cm}|p{2cm}|p{7cm}|p{2cm}|p{2cm}|
Expand Down
16 changes: 12 additions & 4 deletions src/app/pages/portal/portal.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
(click)="onBackdropClick()">
</igo-backdrop>

<igo-menu-button
[sidenavOpened]="sidenavOpened"
(openSidenav)="onToggleSidenavClick()">
</igo-menu-button>
<button
mat-icon-button
id= "menu-button"
[ngClass]="menuButtonClass"
color="primary"
tooltip-position="below"
matTooltipShowDelay="500"
[matTooltip]="(sidenavOpened ? 'menu.close' : 'menu.open') | translate"
(click)="onToggleSidenavClick()">
<mat-icon svgIcon="menu">
</mat-icon>
</button>

<igo-search-bar
#searchBar
Expand Down
29 changes: 28 additions & 1 deletion src/app/pages/portal/portal.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,42 @@

/*** Menu button ***/

igo-menu-button {
.menu-button-reverse-color {
height: 40px;
position: absolute;
top: 3px;
z-index: 4;
border-radius: 0;
height: 45px;
width: 48px;
}

.menu-button-reverse-color-close {

position: absolute;
left: $igo-margin;
top: $igo-margin;
z-index: 4;
border-radius: 0;
}

mat-icon.disabled {
color: rgba(0, 0, 0, 0.38);
}

.menu-button {
background-color: $app-background-color;
position: absolute;
left: $igo-margin;
top: $igo-margin;
z-index: 4;
border-radius: 0;
}

.menu-button ::ng-deep div.mat-button-ripple-round {
border-radius: 0;
}

/*** Map browser ***/
igo-map-browser {
width: 100%;
Expand Down
86 changes: 31 additions & 55 deletions src/app/pages/portal/portal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@angular/core';
import { ActivatedRoute, Params } from '@angular/router';
import { Subscription, of, BehaviorSubject, combineLatest } from 'rxjs';
import { debounceTime, take, pairwise, skipWhile, first } from 'rxjs/operators';
import { debounceTime, take, pairwise, skipWhile } from 'rxjs/operators';
import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
import MapBrowserEvent from 'ol/MapBrowserEvent';
import * as olProj from 'ol/proj';
Expand Down Expand Up @@ -63,8 +63,7 @@ import {
WfsWorkspace,
FeatureWorkspace,
generateIdFromSourceOptions,
computeOlFeaturesExtent,
addStopToStore
computeOlFeaturesExtent
} from '@igo2/geo';

import {
Expand All @@ -73,8 +72,7 @@ import {
SearchState,
QueryState,
ContextState,
WorkspaceState,
DirectionState
WorkspaceState
} from '@igo2/integration';

import {
Expand Down Expand Up @@ -127,6 +125,8 @@ export class PortalComponent implements OnInit, OnDestroy {
};
public workspaceMenuClass = 'workspace-menu';

public menuButtonClass;

public fullExtent = this.storageService.get('fullExtent') as boolean;
private workspaceMaximize$$: Subscription[] = [];
readonly workspaceMaximize$: BehaviorSubject<boolean> = new BehaviorSubject(
Expand Down Expand Up @@ -159,6 +159,7 @@ export class PortalComponent implements OnInit, OnDestroy {
undefined
);
private routeParams: Params;
private menuButtonReverseColor = false;
public toastPanelHtmlDisplay = false;

@ViewChild('mapBrowser', { read: ElementRef, static: true })
Expand Down Expand Up @@ -309,8 +310,7 @@ export class PortalComponent implements OnInit, OnDestroy {
private welcomeWindowService: WelcomeWindowService,
public dialogWindow: MatDialog,
private queryService: QueryService,
private storageService: StorageService,
private directionState: DirectionState
private storageService: StorageService
) {
this.hasExpansionPanel = this.configService.getConfig('hasExpansionPanel');
this.hasGeolocateButton =
Expand All @@ -329,6 +329,15 @@ export class PortalComponent implements OnInit, OnDestroy {
if (this.igoSearchPointerSummaryEnabled === undefined) {
this.igoSearchPointerSummaryEnabled = this.storageService.get('searchPointerSummaryEnabled') as boolean || false;
}

if (
typeof this.configService.getConfig('menuButtonReverseColor') !==
'undefined'
) {
this.menuButtonReverseColor = this.configService.getConfig(
'menuButtonReverseColor'
);
}
}

ngOnInit() {
Expand Down Expand Up @@ -440,6 +449,7 @@ export class PortalComponent implements OnInit, OnDestroy {
this.openSidenav();
this.toolState.openSidenav$.next(false);
}
this.menuButtonClass = this.getClassMenuButton();
}
);

Expand All @@ -463,6 +473,20 @@ export class PortalComponent implements OnInit, OnDestroy {
}
}

getClassMenuButton() {
if (this.sidenavOpened) {
return {
'menu-button': this.menuButtonReverseColor === false,
'menu-button-reverse-color': this.menuButtonReverseColor === true
};
} else {
return {
'menu-button': this.menuButtonReverseColor === false,
'menu-button-reverse-color-close ': this.menuButtonReverseColor === true
};
}
}

workspaceVisibility(): boolean {
const wks = (this.selectedWorkspace$.value as WfsWorkspace | FeatureWorkspace);
if (wks.inResolutionRange$.value) {
Expand Down Expand Up @@ -1050,54 +1074,6 @@ export class PortalComponent implements OnInit, OnDestroy {
this.openSidenav();
}, 250);
}

if (this.routeParams['routing']) {
let routingCoordLoaded = false;
const stopCoords = this.routeParams['routing'].split(';');
const routingOptions = this.routeParams['routingOptions'];
let resultSelection: number;
if (routingOptions) {
resultSelection = parseInt(routingOptions.split('result:')[1], 10);
}
this.directionState.stopsStore.storeInitialized$
.pipe(skipWhile(init => !init), first())
.subscribe((init: boolean) => {
if (init && !routingCoordLoaded) {
routingCoordLoaded = true;
stopCoords.map((coord, i) => {
if (i > 1) {
addStopToStore(this.directionState.stopsStore);
}
});
setTimeout(() => {
stopCoords.map((coord, i) => {
const stop = this.directionState.stopsStore.all().find(e => e.position === i);
stop.text = coord;
stop.coordinates = coord.split(',');
this.directionState.stopsStore.update(stop);
});
}, this.directionState.debounceTime * 1.25); // this delay is due to the default component debounce time
}
});
// zoom to active route
this.directionState.routesFeatureStore.count$
.pipe(skipWhile(c => c < 1), first())
.subscribe(c => {
if (c >= 1) {
this.directionState.zoomToActiveRoute$.next();
}
});
// select the active route by url controls
this.directionState.routesFeatureStore.count$
.pipe(skipWhile(c => c < 2), first())
.subscribe(() => {
if (resultSelection) {
this.directionState.routesFeatureStore.entities$.value.map(d => d.properties.active = false);
this.directionState.routesFeatureStore.entities$.value[resultSelection].properties.active = true;
this.directionState.zoomToActiveRoute$.next();
}
});
}
}

private readLayersQueryParams(params: Params) {
Expand Down
14 changes: 14 additions & 0 deletions src/app/pages/portal/portal.theming.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,18 @@
@include app-sidenav-theming($theme);
@include igo-welcome-window-theming($theme);
$primary: map-get($theme, primary);

.menu-button-reverse-color-close {
background-color: mat.get-color-from-palette($primary);
color: mat.get-color-from-palette($primary, default-contrast);
}

.menu-button-reverse-color {
background-color: matget-color-from-palette($primary);
color: mat.get-color-from-palette($primary, default-contrast);
}

.menu-button {
color: mat.get-color-from-palette($primary);
}
}
2 changes: 1 addition & 1 deletion src/config/interactiveTour.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"position": "auto",
"steps": [
{
"element": "#menu-button",
"element": ".menu-button",
"title": "interactiveTour.global.menu-button-title",
"text": "interactiveTour.global.menu-button",
"onHide": {
Expand Down
Loading

0 comments on commit cb00521

Please sign in to comment.