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

Change mapping from zoom levels to geohash precision #8000

Merged
merged 3 commits into from
Aug 17, 2016

Conversation

thomasneirynck
Copy link
Contributor

@thomasneirynck thomasneirynck commented Aug 15, 2016

Addresses #7882, by improving the mapping from zoom level to geohash precision.

I split this off from #7915. This PR is stripped from the implementation changes for scaled_circles. That was only tangentially related to the issue, and cluttered the PR.

@thomasneirynck
Copy link
Contributor Author

thomasneirynck commented Aug 15, 2016

failing screenshot test for tile map. This needs to be updated to match the new zoom->precision configuration.

@w33ble @jbudz feel free to already start reviewing, but I will need to fix this test regardless.

- the precision level does not grow as quickly as previously.
This caused circles to look really small on some zoom levels. The
determination of the precision is now based on a heuristic based on the
min-width of the geohash-cell for a given zoom level
- add unit tests (previously absent)
for (let zoom = 0; zoom <= 21; zoom += 1) {
const worldPixels = 256 * Math.pow(2, zoom);
zoomPrecision[zoom] = 1;
for (let precision = 2; precision <= 12; precision += 1) {
Copy link
Member

Choose a reason for hiding this comment

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

does it make sense to use config.get('visualization:tileMap:maxPrecision') here instead of 12?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually, it does. I missed that setting, thx!

@jbudz
Copy link
Member

jbudz commented Aug 15, 2016

nitpicky comment above, otherwise this LGTM.

@thomasneirynck thomasneirynck force-pushed the fix/7882_zoom_precision branch from 82bf5be to 75c347b Compare August 15, 2016 19:47
@jbudz
Copy link
Member

jbudz commented Aug 15, 2016

LGTM

@jbudz jbudz removed their assignment Aug 15, 2016
if (vis.hasUiState()) {
currZoom = parseInt(vis.uiStateVal('mapZoom'));
}
const autoPrecisionVal = zoomPrecision[currZoom >= 0 ? currZoom : parseInt(vis.params.mapZoom)];
Copy link
Contributor

@w33ble w33ble Aug 15, 2016

Choose a reason for hiding this comment

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

You should give parseInt a radix of 10, here and a couple lines up.

@thomasneirynck thomasneirynck force-pushed the fix/7882_zoom_precision branch from 4f3d8ff to 6309855 Compare August 16, 2016 00:15
@w33ble
Copy link
Contributor

w33ble commented Aug 17, 2016

The dots on the map look massively improved here. Nice!

Before

screenshot 2016-08-17 10 46 20
screenshot 2016-08-17 10 46 04

After

screen shot 2016-08-17 at 10 49 54 am
screenshot 2016-08-17 10 44 21

@w33ble
Copy link
Contributor

w33ble commented Aug 17, 2016

LGTM!

@thomasneirynck thomasneirynck merged commit b98339b into elastic:master Aug 17, 2016
@thomasneirynck thomasneirynck deleted the fix/7882_zoom_precision branch August 17, 2016 18:26
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
…cision

Change mapping from zoom levels to geohash precision

Former-commit-id: b98339b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants