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

Missing maxNativeZoom for vector tiles in iOS lib #2761

Closed
millenbop opened this issue Oct 23, 2015 · 9 comments
Closed

Missing maxNativeZoom for vector tiles in iOS lib #2761

millenbop opened this issue Oct 23, 2015 · 9 comments
Labels

Comments

@millenbop
Copy link

We serve vector tiles up to zoom level 16, but sometimes we need to go up to zoom level 18. If the tiles are loaded at a lower zoom level and the map is zoomed in, it seems to interpolate the vector tiles it already has, but if the map starts loading at zoom level > 16, they are not displayed.

It's not a very clean solution and is prone to errors.

It would be very useful to have maxNativeZoom in this lib (for iOS) as well, similar to https://www.mapbox.com/mapbox.js/api/v2.2.2/l-tilelayer/

Option Description
minZoom Minimum zoom number.
maxZoom Maximum zoom number.
maxNativeZoom Maximum zoom number the tiles source has available. If it is specified, the tiles on all zoom levels higher than maxNativeZoom will be loaded from maxZoom level and auto-scaled.
@jfirebaugh
Copy link
Contributor

if the map starts loading at zoom level > 16, they are not displayed

This behavior is not expected -- it should display the z16 level tiles.

In short, since vector tiles are highly amenable to overscaling, it's always assumed that maxZoom for a vector tile source should be treated as "maxNativeZoom", and we will likely not add a separate option. There is a separate map-wide maximum zoom -- currently 18, but we intend to make that configurable.

@millenbop
Copy link
Author

Ah, sounds like a bug then. There is no property for maxZoom in the iOS lib though. If I put "maxZoom": 16 in the layer style, it still tries to load zoom levels over 16:

2015-10-26 13:13:29.183 Mapillary[19832:316569] [ERROR] {Map}[Style]: Failed to load [https://SOMEURL/tiles/17/70341/40998.mapbox]: HTTP status code 403 2015-10-26 13:13:29.217 Mapillary[19832:316569] [ERROR] {Map}[Style]: Failed to load [https://SOMEURL/tiles/18/140682/81997.mapbox]: HTTP status code 403

@ljbade ljbade added bug iOS Mapbox Maps SDK for iOS labels Oct 26, 2015
@friedbunny friedbunny removed the iOS Mapbox Maps SDK for iOS label Oct 26, 2015
@millenbop
Copy link
Author

Thanks for fixing this! Just integrated 3.0 and works like a charm.

@jfirebaugh
Copy link
Contributor

Great! We didn't knowingly do anything to fix this for 3.0, but it's possible it got fixed as a side effect of something else.

@millenbop
Copy link
Author

I'm sorry, I was a bit fast there, it still tries to load tiles for zoom levels that doesn't exist. So please reopen!

img_1195
img_1196

Did some work on the map parts in the app today and it doesn't work. I was just being lucky before, i.e. I had zoom set at 10 and our tiles were loaded, than when zoomed to > 16, it (probably) interpolated those tiles.

Maybe I'm doing something wrong here. In the style I set add our layer this way:

source:
"mapillary": {
    "tiles": [
        "https://SOMEURL/tiles/{z}/{x}/{y}.mapbox"
    ],
    "type": "vector"
}

layer:
{
    "id": "mapillary",
    "maxzoom": 16,
    "type": "line",
    "source": "mapillary",
    "source-layer": "mapillary-sequences",
    "interactive": true,
    "layout": {
        "line-join": "round",
        "line-cap": "round"
    },
    "paint": {
        "line-opacity": 0.6,
        "line-color": "#35af6d",
        "line-width": 2
    }
}

and I expect it to only load tiles for zoom level 16 and lower, but still get

2015-12-15 15:13:09.964 Mapillary[734:114998] [ERROR] {Map}[Style]: Failed to load [https://SOMEURL/tiles/17/70274/41071.mapbox]:

@jfirebaugh jfirebaugh reopened this Dec 15, 2015
@millenbop
Copy link
Author

It seems it has gotten worse in later releases. I hope this video will help illustrate the problem better.

Untitled.mp4.zip

@millenbop
Copy link
Author

Perhaps the original post is a bit off and should create a new one?

@jfirebaugh
Copy link
Contributor

@millenbop Yes, can you please create a new issue if this is still occurring?

@millenbop
Copy link
Author

Yeah seems like it still exists. I have created #4969

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants