Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

max zoom > 18 #509

Closed
incanus opened this issue Oct 27, 2014 · 15 comments · Fixed by #3712
Closed

max zoom > 18 #509

incanus opened this issue Oct 27, 2014 · 15 comments · Fixed by #3712
Assignees
Labels
Android Mapbox Maps SDK for Android GL JS parity For feature parity with Mapbox GL JS iOS Mapbox Maps SDK for iOS refactor

Comments

@incanus
Copy link
Contributor

incanus commented Oct 27, 2014

This was changed back in #178 but should:

  1. Allow for zoom > 18
  2. Allow for setting min/max from external API
@mb12
Copy link

mb12 commented Oct 30, 2014

The reason this limit is 18 is because max placement depth is 3 and maximum zoom for default mapbox tile source is 15. When doing placement, placement is done for the current zoom level plus placement depth. The placement depth is capped at 3 for highest zoom level in the SourceInfo.
You can verify this by placing a breakpoint in Collision::Collision and stepping through to verify how placementDepth is modified.

So increasing this value to higher than 18 without changing the placement algorithm would cause extremely sparse labels beyond 18. I would also recommend against simply changing placementDepth to higher than 3 would cause extreme slowdown in creating the SymbolBucket.

@donpark
Copy link

donpark commented Nov 22, 2014

I'd recommend upping the maximum zoom level to 23 then either auto-hiding labels beyond zoom level 18 in code or in style.

@manuelwenner
Copy link

What about max zoom Level in mapbox-gl-native for android? When i try to set zoom level >18.0 it's ignored.

Thanks in advance for your answers.

@tmpsantos
Copy link
Contributor

What about max zoom Level in mapbox-gl-native for android? When i try to set zoom level >18.0 it's ignored.

Thanks in advance for your answers

@manuelwenner It is currently hardcoded. Until we provide an API for that, you can tweak it at this variable here: https://github.com/mapbox/mapbox-gl-native/blob/master/src/mbgl/map/transform.hpp#L87

@manuelwenner
Copy link

Thanks @tmpsantos that worked perfect for me.

@petaren
Copy link

petaren commented Oct 14, 2015

Is there an estimated time as to when an increase in max zoom level might be available? We would need a max zoom level of around 20 in my current project. Without it, it's unfortunately useless for us :(

@tmpsantos
Copy link
Contributor

Is there an estimated time as to when an increase in max zoom level might be available? We would need a max zoom level of around 20 in my current project. Without it, it's unfortunately useless for us :(

Not on the roadmap AFAIK, but you can change that on the code for now.

@petaren
Copy link

petaren commented Oct 15, 2015

Okey, L87 in transform.hpp is blank. So what do I need to change to get it to work?

@mourner
Copy link
Member

mourner commented Oct 15, 2015

It's hardcoded here now:

double min_scale = std::pow(2, 0);
double max_scale = std::pow(2, 18);

I think we should address this issue sooner, shouldn't be hard and is an often requested feature.

@franckt
Copy link

franckt commented Jan 21, 2016

Hi,
Any news about providing an api to set max zoom ?

@ansis
Copy link
Contributor

ansis commented Jan 29, 2016

@franckt max zoom is implemented in master and should be available in the next release

@bleege bleege added iOS Mapbox Maps SDK for iOS Android Mapbox Maps SDK for Android labels Feb 3, 2016
@bleege
Copy link
Contributor

bleege commented Feb 3, 2016

Re-opening as discussion with @kkaefer this morning revealed that the max zoom level in mgbl is actually 25.5. We'll need to update the iOS and Android bindings added in PR #3712 to support this.

/cc @mapbox/mobile

@bleege bleege reopened this Feb 3, 2016
@bleege bleege added this to the android-v4.0.0 milestone Feb 3, 2016
@ansis ansis removed their assignment Feb 3, 2016
bleege added a commit that referenced this issue Feb 3, 2016
…in Android. Clamping Min and Max zooms at Core GL for all platforms to use at runtime.
@bleege
Copy link
Contributor

bleege commented Feb 4, 2016

Capturing discussing with @1ec5 this afternoon where he confirmed that the 20 in transform_state.hpp is simply a default value and that if the bindings set a zoom higher (example 23) then Core GL will use and go to 23.

@bleege
Copy link
Contributor

bleege commented Feb 4, 2016

The new code in PR #3812 adds min and max zoom controls to Core GL so that all platforms will benefit. It also updated the values in the Android annotation warnings. The new values are:

MIN_ZOOM = 0.0
MAX_ZOOM = 25.5

@brunoabinader
Copy link
Member

Possibly related: #4168 / #3644.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android GL JS parity For feature parity with Mapbox GL JS iOS Mapbox Maps SDK for iOS refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.