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)