Skip to content

Should only fit on shapes that are part of the result#12881

Merged
thomasneirynck merged 2 commits intoelastic:masterfrom
thomasneirynck:fix/fit_on_choropleth
Jul 24, 2017
Merged

Should only fit on shapes that are part of the result#12881
thomasneirynck merged 2 commits intoelastic:masterfrom
thomasneirynck:fix/fit_on_choropleth

Conversation

@thomasneirynck
Copy link
Copy Markdown
Contributor

@thomasneirynck thomasneirynck commented Jul 14, 2017

Release Note: When clicking the fit-data button in a Region Map, the map now zooms correctly to the relevant data instead of showing the entire layer.


Closes #12220.

@thomasneirynck
Copy link
Copy Markdown
Contributor Author

jenkins, test this

@thomasneirynck thomasneirynck changed the title fit should only fit on shapes that are part of the result Should only fit on shapes that are part of the result Jul 14, 2017
@thomasneirynck thomasneirynck added Feature:Visualizations Generic visualization features (in case no more specific feature label is available) v5.5.1 v5.6.0 v6.0.0 labels Jul 14, 2017
@thomasneirynck thomasneirynck requested a review from ppisljar July 16, 2017 23:19
Copy link
Copy Markdown
Contributor

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

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

tested and it works ok, LGTM

Copy link
Copy Markdown
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

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

LGTM, though I do have a suggestion

const outstandingFeatures = data.slice();


const joinedShapes = [];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this would be a little easier for me to understand if we tracked the bounds here, extended it on each call to getLeafletStyleFunction, and just returned the current version in getLeafletBounds().

let bounds = new L.LatLngBounds()
...
bounds = bounds.extend(L.geoJson(shape).getBounds())
...
return bounds;

@thomasneirynck thomasneirynck force-pushed the fix/fit_on_choropleth branch from fdc0408 to 0bd8008 Compare July 20, 2017 16:05
@thomasneirynck
Copy link
Copy Markdown
Contributor Author

jenkins, test this

Copy link
Copy Markdown
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@thomasneirynck thomasneirynck force-pushed the fix/fit_on_choropleth branch from 0bd8008 to 0ee9054 Compare July 20, 2017 19:26
@thomasneirynck
Copy link
Copy Markdown
Contributor Author

jenkins, test this

@thomasneirynck thomasneirynck force-pushed the fix/fit_on_choropleth branch from 0ee9054 to bd626ce Compare July 21, 2017 14:39
@thomasneirynck
Copy link
Copy Markdown
Contributor Author

jenkins, test this

@epixa epixa added v5.5.2 and removed v5.5.1 labels Jul 21, 2017
@thomasneirynck thomasneirynck force-pushed the fix/fit_on_choropleth branch from bd626ce to ab29e41 Compare July 24, 2017 14:10
@thomasneirynck thomasneirynck merged commit 37fc949 into elastic:master Jul 24, 2017
thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request Jul 24, 2017
thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request Jul 24, 2017
@thomasneirynck
Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:fix review v5.5.2 v5.6.0 v6.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants