From f3c55560abc449e4cabe8acd3cca3f90a1233076 Mon Sep 17 00:00:00 2001
From: ncastejon <castejon.nicolas@gmail.com>
Date: Wed, 16 Oct 2019 09:49:26 +0200
Subject: [PATCH] Fix flyTo when click on the map

---
 src/app/map/services/map.service.ts | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/app/map/services/map.service.ts b/src/app/map/services/map.service.ts
index f503a434..a1ded797 100644
--- a/src/app/map/services/map.service.ts
+++ b/src/app/map/services/map.service.ts
@@ -172,7 +172,14 @@ export class MapService {
           // 70 is the width of the dataset data details panel divided by 4 (by 2 because the map and the table
           // share the remaining space and again by 2 because we want to center the point so there is half on the
           // left, half on the right)
-          this._map.flyTo({ center: e.lngLat, curve: 1, speed: 0.4, offset: new mapboxgl.Point(-70, 0) });
+          this._map.panTo(e.lngLat, {
+            duration: 500,
+            // 70 is the width of the dataset data details panel divided by 4 (by 2 because the map and the table
+            // share the remaining space and again by 2 because we want to center the point so there is half on the
+            // left, half on the right)
+            offset: new mapboxgl.Point(-70, 0),
+          },
+          );
         }
       }
 
@@ -503,7 +510,6 @@ export class MapService {
         // left, half on the right)
         offset: new mapboxgl.Point(-70, 0),
       },
-
       );
 
     }
-- 
GitLab