mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Merge pull request #7068 from panda01/fix/extraneous-bounds
Fix extraneous bounds
This commit is contained in:
commit
c3d15a9871
1 changed files with 10 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue