diff --git a/x-pack/legacy/plugins/maps/public/connected_components/map/mb/view.js b/x-pack/legacy/plugins/maps/public/connected_components/map/mb/view.js index cf6085e0c398cb..1e44c7225a564c 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/map/mb/view.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/map/mb/view.js @@ -107,7 +107,6 @@ export class MBMapContainer extends React.Component { } async _createMbMapInstance() { - const initialView = this.props.goto ? this.props.goto.center : null; return new Promise(resolve => { const mbStyle = { version: 8, @@ -127,12 +126,15 @@ export class MBMapContainer extends React.Component { preserveDrawingBuffer: chrome.getInjected('preserveDrawingBuffer', false), interactive: !this.props.disableInteractive, }; + const initialView = _.get(this.props.goto, 'center'); if (initialView) { options.zoom = initialView.zoom; options.center = { lng: initialView.lon, lat: initialView.lat, }; + } else { + options.bounds = [-170, -60, 170, 75]; } const mbMap = new mapboxgl.Map(options); mbMap.dragRotate.disable(); diff --git a/x-pack/legacy/plugins/maps/public/reducers/map.js b/x-pack/legacy/plugins/maps/public/reducers/map.js index f933babb6f61b8..234584d08a3114 100644 --- a/x-pack/legacy/plugins/maps/public/reducers/map.js +++ b/x-pack/legacy/plugins/maps/public/reducers/map.js @@ -99,11 +99,8 @@ const INITIAL_STATE = { goto: null, tooltipState: null, mapState: { - zoom: 4, - center: { - lon: -100.41, - lat: 32.82, - }, + zoom: null, // setting this value does not adjust map zoom, read only value used to store current map zoom for persisting between sessions + center: null, // setting this value does not adjust map view, read only value used to store current map center for persisting between sessions scrollZoom: true, extent: null, mouseCoordinates: null,