From 17dc6d444cd95ec6b30a826213c526103f3967e6 Mon Sep 17 00:00:00 2001
From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com>
Date: Fri, 30 Oct 2020 14:51:46 +0100
Subject: [PATCH] feat: update map control position

---
 src/app/map/components/map.component.scss                | 9 +++++++++
 src/app/map/components/map.component.ts                  | 6 ++++--
 src/app/structure-list/components/card/card.component.ts | 2 +-
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/app/map/components/map.component.scss b/src/app/map/components/map.component.scss
index 3e717886a..765479d97 100644
--- a/src/app/map/components/map.component.scss
+++ b/src/app/map/components/map.component.scss
@@ -69,3 +69,12 @@
     display: flex;
   }
 }
+
+::ng-deep .leaflet-left {
+  right: 0;
+  left: unset;
+  .leaflet-control {
+    margin-left: 0;
+    margin-right: 10px;
+  }
+}
diff --git a/src/app/map/components/map.component.ts b/src/app/map/components/map.component.ts
index b03a4052c..adbca64a5 100644
--- a/src/app/map/components/map.component.ts
+++ b/src/app/map/components/map.component.ts
@@ -1,5 +1,5 @@
-import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
-import { latLng, MapOptions, tileLayer, Map, CRS, TileLayer, LatLngBounds, latLngBounds } from 'leaflet';
+import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';
+import { latLng, MapOptions, tileLayer, Map, CRS, TileLayer, LatLngBounds, latLngBounds, Control } from 'leaflet';
 import { Observable } from 'rxjs';
 import { mergeMap } from 'rxjs/operators';
 import { Structure } from '../../models/structure.model';
@@ -7,6 +7,7 @@ import { GeoJson } from '../models/geojson.model';
 import { GeojsonService } from '../../services/geojson.service';
 import { MapService } from '../services/map.service';
 import { LeafletControlLayersChanges } from '@asymmetrik/ngx-leaflet';
+import { NgxLeafletLocateComponent } from '@runette/ngx-leaflet-locate';
 
 @Component({
   selector: 'app-map',
@@ -17,6 +18,7 @@ export class MapComponent implements OnChanges {
   @Input() public structures: Structure[] = [];
   @Input() public toogleToolTipId: number;
   @Input() public selectedMarkerId: number;
+  @ViewChild(NgxLeafletLocateComponent, { static: false }) locateComponent: NgxLeafletLocateComponent;
   public map: Map;
   public mapOptions: MapOptions;
   // Init locate options
diff --git a/src/app/structure-list/components/card/card.component.ts b/src/app/structure-list/components/card/card.component.ts
index 6c8706c2d..606792875 100644
--- a/src/app/structure-list/components/card/card.component.ts
+++ b/src/app/structure-list/components/card/card.component.ts
@@ -41,7 +41,7 @@ export class CardComponent implements OnInit {
     this.showDetails.emit(this.structure);
   }
 
-  public cardHover(hoverOut: boolean): void {
+  public cardHover(): void {
     this.hover.emit(this.structure);
   }
 }
-- 
GitLab