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

min_display_zoom & max_display_zoom #944

Merged
merged 12 commits into from Sep 8, 2016

Conversation

Projects
None yet
4 participants
@hallahan
Contributor

hallahan commented Aug 30, 2016

This PR allows you to set a min_zoom parameter in your sources block of your scene.yaml.

When a source is given a min_zoom parameter, it does not fetch tiles below that min zoom. This includes the raster sub-sources we see with normals, as found in Walkabout and other terrain styles.

As @bcamper mentioned, we might actually want to call this parameter min_display_zoom, since we don't under-zoom data at lower zooms--we simply don't provide it.

I'm happy to re-factor that into this PR. Also, we could take a similar approach found here to implement max_display_zoom.

tangrams/tangram#394

Thinking about also implementing bounds, we could build that into DataSource#isActiveForZoom, calling it isActive instead.

cc/ @tallytalwar @blair1618 @bcamper

@hallahan hallahan changed the title from Min Zoom to min_display_zoom & max_display_zoom Sep 6, 2016

@hallahan

This comment has been minimized.

Show comment
Hide comment
@hallahan

hallahan Sep 6, 2016

Contributor

At this point, I've refactored min_zoom to be min_display_zoom. I have also implemented max_display_zoom.

Contributor

hallahan commented Sep 6, 2016

At this point, I've refactored min_zoom to be min_display_zoom. I have also implemented max_display_zoom.

@hallahan

This comment has been minimized.

Show comment
Hide comment
@hallahan

hallahan Sep 6, 2016

Contributor

Interesting, Travis caught that Android was missing the #define for INT32_MAX. Perhaps I should just #ifndef in the value to the token in the header?

Contributor

hallahan commented Sep 6, 2016

Interesting, Travis caught that Android was missing the #define for INT32_MAX. Perhaps I should just #ifndef in the value to the token in the header?

@tallytalwar

This comment has been minimized.

Show comment
Hide comment
@tallytalwar

tallytalwar Sep 6, 2016

Member

Can you rebase this with master? some of the commits you have above have already been merged!

Member

tallytalwar commented Sep 6, 2016

Can you rebase this with master? some of the commits you have above have already been merged!

@@ -143,6 +145,7 @@ void DataSource::constructURL(const TileID& _tileCoord, std::string& _url) const
bool DataSource::equals(const DataSource& other) const {
if (m_name != other.m_name) { return false; }
if (m_urlTemplate != other.m_urlTemplate) { return false; }
if (m_minDisplayZoom != other.m_minDisplayZoom) { return false; }

This comment has been minimized.

@tallytalwar

tallytalwar Sep 6, 2016

Member

Missing check for m_maxDisplayZoom for DataSource equality.

@tallytalwar

tallytalwar Sep 6, 2016

Member

Missing check for m_maxDisplayZoom for DataSource equality.

This comment has been minimized.

@hallahan

hallahan Sep 6, 2016

Contributor

Done via 108ab3c

@hallahan

hallahan Sep 6, 2016

Contributor

Done via 108ab3c

@@ -105,6 +115,12 @@ class DataSource : public std::enable_shared_from_this<DataSource> {
// Name used to identify this source in the style sheet
std::string m_name;
// Minimum zoom for which tiles will be displayed
int32_t m_minDisplayZoom;

This comment has been minimized.

@tallytalwar

tallytalwar Sep 6, 2016

Member

nitpick, but why not int16_t?

@tallytalwar

tallytalwar Sep 6, 2016

Member

nitpick, but why not int16_t?

This comment has been minimized.

@hallahan

hallahan Sep 6, 2016

Contributor

I can switch m_minDisplayZoom to be int16_t, however, that would be inconsistent with m_maxZoom which has always been int32_t. We really could have all these zoom vars be int8_t (max value of 127)

@hallahan

hallahan Sep 6, 2016

Contributor

I can switch m_minDisplayZoom to be int16_t, however, that would be inconsistent with m_maxZoom which has always been int32_t. We really could have all these zoom vars be int8_t (max value of 127)

This comment has been minimized.

@tallytalwar

tallytalwar Sep 6, 2016

Member

Ohh I forgot about these. You can leave it 32 bit right now. Though I think all these can be 8 bit but I might have to look as why we had it as 32 in the beginning.

@tallytalwar

tallytalwar Sep 6, 2016

Member

Ohh I forgot about these. You can leave it 32 bit right now. Though I think all these can be 8 bit but I might have to look as why we had it as 32 in the beginning.

This comment has been minimized.

@hallahan

hallahan Sep 6, 2016

Contributor

👍

@hallahan

hallahan Sep 6, 2016

Contributor

👍

@hallahan

This comment has been minimized.

Show comment
Hide comment
@hallahan

hallahan Sep 7, 2016

Contributor

@tallytalwar - I implemented the proposed changes. Ready for another look. Thanks!

Contributor

hallahan commented Sep 7, 2016

@tallytalwar - I implemented the proposed changes. Ready for another look. Thanks!

@tallytalwar

This comment has been minimized.

Show comment
Hide comment
@tallytalwar

tallytalwar Sep 7, 2016

Member

Changes look good, once the comments are addressed and propertly rebased with master will merge.

Thanks @hallahan

Member

tallytalwar commented Sep 7, 2016

Changes look good, once the comments are addressed and propertly rebased with master will merge.

Thanks @hallahan

@tallytalwar

This comment has been minimized.

Show comment
Hide comment
@tallytalwar

tallytalwar Sep 7, 2016

Member

This is good to go, merging when travis goes green.

Member

tallytalwar commented Sep 7, 2016

This is good to go, merging when travis goes green.

@tallytalwar tallytalwar merged commit 94a0ac2 into tangrams:master Sep 8, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment