diff --git a/packages/integration/src/lib/map/map-proximity-tool/map-proximity-tool.component.html b/packages/integration/src/lib/map/map-proximity-tool/map-proximity-tool.component.html index fcc56b08c4..a3f11e69e0 100644 --- a/packages/integration/src/lib/map/map-proximity-tool/map-proximity-tool.component.html +++ b/packages/integration/src/lib/map/map-proximity-tool/map-proximity-tool.component.html @@ -27,7 +27,7 @@
- + {{'igo.integration.map-proximity-tool.radiusM' | translate}} diff --git a/packages/integration/src/lib/map/map-proximity-tool/map-proximity-tool.component.scss b/packages/integration/src/lib/map/map-proximity-tool/map-proximity-tool.component.scss index d6dbd679e3..0c80e70f1f 100644 --- a/packages/integration/src/lib/map/map-proximity-tool/map-proximity-tool.component.scss +++ b/packages/integration/src/lib/map/map-proximity-tool/map-proximity-tool.component.scss @@ -21,14 +21,13 @@ mat-form-field.igo-input-container { width: 60%; padding: 0px 15px; }; width: 90%; margin-left: 2px; padding: 5px; + mat-form-field.radius-field { + display: flex; + flex-flow: column nowrap; + width: 100%; + } } -.radius-field { - - display: flex; - flex-flow: column nowrap; - width: 60%; -} .title-container { padding: 10px; } diff --git a/packages/integration/src/lib/map/map-proximity.state.ts b/packages/integration/src/lib/map/map-proximity.state.ts index 7f09af846b..976f4bf302 100644 --- a/packages/integration/src/lib/map/map-proximity.state.ts +++ b/packages/integration/src/lib/map/map-proximity.state.ts @@ -16,6 +16,7 @@ import olVectorSource from 'ol/source/Vector'; import Geometry from 'ol/geom/Geometry'; import olLineString from 'ol/geom/LineString'; import * as olProj from 'ol/proj'; +import { StorageService } from '@igo2/core'; /** * Service that holds the state of the direction module */ @@ -24,8 +25,11 @@ import * as olProj from 'ol/proj'; }) export class MapProximityState { + private defaultProximityRadiusValue: number = 30; + public enabled$: BehaviorSubject = new BehaviorSubject(false); - public proximityRadiusValue$: BehaviorSubject = new BehaviorSubject(30); + public proximityRadiusValue$: BehaviorSubject = new BehaviorSubject( + this.storageService.get('mapProximityRadius') as number || this.defaultProximityRadiusValue); public proximitylocationType$: BehaviorSubject = new BehaviorSubject('geolocation'); public proximityFeatureStore: FeatureStore = new FeatureStore([], { map: this.mapState.map }); private subs$$: Subscription[] = []; @@ -35,7 +39,9 @@ export class MapProximityState { return this.mapState.map; } - constructor(private mapState: MapState) { + constructor( + private mapState: MapState, + private storageService: StorageService) { this.mapState.map.ol.once('rendercomplete', () => { this.subscribeProximityMonitor(); @@ -59,6 +65,7 @@ export class MapProximityState { const currentPos = this.map.geolocationController.position$.value; const locationType = bunch[1]; const proximityRadiusValue = bunch[2]; + this.storageService.set('mapProximityRadius', proximityRadiusValue || this.defaultProximityRadiusValue); if (!enabled) { return;