From 519f867a4f88f933bb1924acc95065d7cdf258e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Sandvik?= Date: Tue, 26 Nov 2019 16:29:35 +0100 Subject: [PATCH] feat: map style --- src/Map.css | 5 +++++ src/Map.js | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 src/Map.css diff --git a/src/Map.css b/src/Map.css new file mode 100644 index 00000000..a55ffa8d --- /dev/null +++ b/src/Map.css @@ -0,0 +1,5 @@ +.dhis2-map-split-view .mapboxgl-ctrl-group { + position: absolute; + top: 10px; + right: 10px; +} diff --git a/src/Map.js b/src/Map.js index 5ac45c5d..0f8c7d5a 100644 --- a/src/Map.js +++ b/src/Map.js @@ -11,6 +11,8 @@ import Dots from './layers/Dots' import ClientCluster from './layers/ClientCluster' import EarthEngine from './layers/EarthEngine' import { getBoundsFromLayers } from './utils/geometry' +import syncMaps from './utils/sync' +import './Map.css' const layers = { tileLayer: TileLayer, @@ -149,10 +151,14 @@ export class Map extends Evented { } // Synchronize this map with other maps with the same id - sync(id) {} + sync(id) { + syncMaps.add(id, this._mapgl) + } // Remove synchronize of this map - unsync(id) {} + unsync(id) { + syncMaps.remove(id, this._mapgl) + } onClick(evt) { const eventObj = this._createClickEvent(evt)