-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Change mapping from zoom levels to geohash precision #8000
Conversation
7eeadc4
to
6a7e8c3
Compare
- 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)
6a7e8c3
to
273b228
Compare
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
nitpicky comment above, otherwise this LGTM. |
82bf5be
to
75c347b
Compare
LGTM |
if (vis.hasUiState()) { | ||
currZoom = parseInt(vis.uiStateVal('mapZoom')); | ||
} | ||
const autoPrecisionVal = zoomPrecision[currZoom >= 0 ? currZoom : parseInt(vis.params.mapZoom)]; |
There was a problem hiding this comment.
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.
4f3d8ff
to
6309855
Compare
LGTM! |
…cision Change mapping from zoom levels to geohash precision Former-commit-id: b98339b
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.