Skip to content

Commit

Permalink
Merge pull request #7068 from panda01/fix/extraneous-bounds
Browse files Browse the repository at this point in the history
Fix extraneous bounds
  • Loading branch information
panda01 committed Apr 28, 2016
2 parents d7ba2f0 + 822ce39 commit c3d15a9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/ui/public/vislib/visualizations/_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
});
Expand Down

0 comments on commit c3d15a9

Please sign in to comment.