From 822ce3931475c9062f8db261dbee88516257b6bb Mon Sep 17 00:00:00 2001 From: Khalah Jones-Golden Date: Tue, 26 Apr 2016 17:12:57 -0400 Subject: [PATCH] [TileMap] Made it so the tile map wraps bounds that go off the map --- src/ui/public/vislib/visualizations/_map.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ui/public/vislib/visualizations/_map.js b/src/ui/public/vislib/visualizations/_map.js index 3a893c38fd8f..4ba7a0d50dac 100644 --- a/src/ui/public/vislib/visualizations/_map.js +++ b/src/ui/public/vislib/visualizations/_map.js @@ -232,17 +232,25 @@ export default function MapFactory(Private) { // TODO: Different drawTypes need differ info. Need a switch on the object creation let bounds = e.layer.getBounds(); + let SElng = bounds.getSouthEast().lng; + if (SElng > 180) { + SElng -= 360; + } + let NWlng = bounds.getNorthWest().lng; + if (NWlng < -180) { + NWlng += 360; + } self._events.emit(drawType, { e: e, chart: self._chartData, bounds: { top_left: { lat: bounds.getNorthWest().lat, - lon: bounds.getNorthWest().lng + lon: NWlng }, bottom_right: { lat: bounds.getSouthEast().lat, - lon: bounds.getSouthEast().lng + lon: SElng } } });