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

[Maps] tighten default map zoom #56069

merged 3 commits into from
Jan 29, 2020

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Jan 27, 2020

Change new map view from this

Screen Shot 2020-01-27 at 2 43 08 PM

To

Screen Shot 2020-01-27 at 2 42 49 PM

cc @VijayDoshi

@nreese nreese added chore [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.7.0 labels Jan 27, 2020
@nreese nreese requested a review from a team as a code owner January 27, 2020 21:06
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@@ -37,6 +37,10 @@ export function createMapPath(id) {
return `${MAP_BASE_URL}/${id}`;
}

export const DEFAULT_ZOOM = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my setup, I had to increase the zoom value to 2 to get your bounding box, so I'd wait for others to confirm this defaults.

image

Copy link
Member

@nickpeihl nickpeihl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not work for large screens. Maybe instead of setting the zoom and center, we can set an initial bounding box using the options.bounds parameter for the map?

@nreese
Copy link
Contributor Author

nreese commented Jan 28, 2020

This does not work for large screens

How does it not work on large screens? Can you provide a screen shot?

@nickpeihl
Copy link
Member

This does not work for large screens

How does it not work on large screens? Can you provide a screen shot?

For this screenshot, I used the Responsive Design mode in Firefox to set the window size to 2560x1280.
Screen Shot 2020-01-28 at 11 41 13

I believe what happens with this PR is we show more lines of latitude as the screen resolution gets taller. I worked up an example showing how the extent changes as screen height gets larger. The light green line is a resolution of 1366x768, the dark green is 1920x1080, and the red line is 2560x1440.

Screen Shot 2020-01-28 at 15 09 53

@nreese
Copy link
Contributor Author

nreese commented Jan 29, 2020

@elasticmachine merge upstream

@nreese
Copy link
Contributor Author

nreese commented Jan 29, 2020

@jsanz @nickpeihl Thanks for taking a look at this. I have changed the implementation from using zoom/center to using bounds. This provides a more consistent look across various screen resolutions.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@nickpeihl nickpeihl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! works perfectly, even in extremely large resolutions.

@nreese nreese merged commit 59c90f1 into elastic:master Jan 29, 2020
nreese added a commit to nreese/kibana that referenced this pull request Jan 29, 2020
* [Maps] tighten default map zoom

* rework using bounds to work on multiple screen resolutions

Co-authored-by: Elastic Machine <[email protected]>
nreese added a commit that referenced this pull request Jan 29, 2020
* [Maps] tighten default map zoom

* rework using bounds to work on multiple screen resolutions

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation release_note:skip Skip the PR/issue when compiling release notes v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants