Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maps] tighten default map zoom #56069

Merged
merged 3 commits into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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();
Expand Down
7 changes: 2 additions & 5 deletions x-pack/legacy/plugins/maps/public/reducers/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down