-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CORE: Support for Offline Tilesets? #8174
Comments
Hi @nitrag -- good question. Offline features are likely always going to be driven by styles, since they are the unifying top-level concept in the Mapbox GL ecosystem. I can think of a couple ways to accomplish your use case given the existing features:
Will one of those options work for you? |
Thanks for the fast response and glad to know I'm not totally out of luck here.
This sounds easiest. I didn't realize there was a getter on the style. My concern though is hitting the 6000 "resource" limit for offline download. What exactly is a resource anyway?
I understand the download part but I don't understand how to access the data. I need to provide a source layer like so:
Are you saying that after I download the offline pack for the auxiliary style, I'll be able to access those source identifiers with the above command? Also what about the warning? |
You'll only deal with the auxiliary style in conjunction with MGLTilePyramidOfflineRegion, not MGLMapView. Once the offline pack is downloaded, however, you can create a new source that refers to the same tile URL templates as the downloaded offline pack and add that source to the map view. MGLMapView will automatically fetch the downloaded tiles while offline, as if you had used map view's current style with MGLTilePyramidOfflineRegion. I haven't actually tried this approach, but it's worth a shot. |
So I went with @jfirebaugh second option, created an auxiliary style with only my custom tilesets, and downloaded that style into a second pack. All good there. I'm adding my tileset to the map via the following (I don't know how to add additional styleUrls to the map):
Is this what you meant @1ec5 ? Using It works when online.
Looking into the first option, I don't see a way in studio to add a tileset to a style without adding it as a layer too. I can try manipulating the style.json and uploading a custom style with the source attached, but I would have to do this every time I modified the style... |
I was describing the second approach of creating a new vector source, which seems to be what you’re attempting. 👍
There can only be one active style at a time.
What if you force the SDK to open that pack (without displaying it in a map view), by calling |
Yea, no dice. Yes, I'm using the tilesetId, thanks for confirming that I'm not crazy and styleId shouldn't be possible.
I guess I'll attempt option 1. |
Can't get option 1 to work either. App crashes because the
I also have the layer, within the style called |
@jfirebaugh @1ec5 next steps? |
Aha!
Per your suggestion, in Studio for my Auxiliary Style (custom tileset), I tried turning off Compositing. No dice. I removed the layers and re-added. No dice. I wound up having to create a completely new/blank style, then turn off compositing before adding the layers. Bingo, that worked. When I load the map with the Auxiliary Style, I am able to see Can you submit a Bug Fix request to Studio team? To fix the bug which will fix: I'm really lucky I discovered that^, that could really trip the users up. WOOT! WOOT! WOOT! |
That’s great to hear, @nitrag!
The Studio team is aware of this issue. Ultimately, however, we’re hoping to remove the auto-compositing feature in Studio once mapbox/mapbox-gl-js#2703 is implemented across all the Mapbox GL libraries. (@samanpwbb, correct me if I got any of this wrong.) |
@jfirebaugh I'm having a very difficult time getting in touch with sales. As I've tried to explain to them, downloading two offline packs at once effectively halves my tile ceiling to 3k. My users are those who might be off grid for 1-2 weeks at a time. Prior to finding out about this composition issue I was hoping to request double the normal tiles (12k) already but now I technically need 24k to have effectively double. While doubling the tile limit is critical, certainly getting back to the 6000 (12k) limit would support 75% of my users needs. The size of my 2nd tileset (covering the entire USA) is only 100mb. "Enterprise Sales" says raising the tile count isn't possible unless you are on the Enterprise Plan ($499????) due to "technical resources involved in packaging up the tiles" (doesn't make sense - aren't they already packed? Isn't the resources just the download bandwidth?). I think there's a huge disconnect here, I asked for a meeting a week ago. Hoping you can help me out. I was talking to Erin Q. |
@nitrag, increasing the tile ceiling of the Mapbox SDKs is licensed annually as an Enterprise feature - we do not have flexibility on pricing. |
No, tiles for offline packs are requested using the same API as normal map views, and incur the same cost of goods for Mapbox. In addition to bandwidth, this includes cloud compute time and per-request CDN and other networking costs. |
Really? That's a shame it's either $0 or $500 and with no flexibility. I'd
like to know why the $50 was removed too. I started developing with Mapbox
because you didn't seem corporate focused due to open source and scalable
pricing. Guess not.
I'll be posting an article on Medium about this.
|
@jfirebaugh
I have ~1000 app users and am hitting 50k web map views because my app was
using non-Mapbox SDK and the raster URL.
I'd like to know how many map views 50k app *users use*, few million?
That pricing model has always confused me.
|
Wait I read the pricing page wrong. I thought $499 was enterprise but it's only premium. So one would need pay more than $500/mo if you want to raise the tile limit? That's ludicrous! Even if I had 20k mobile app users, that's nowhere near the bandwidth and costs of supporting 200k+ mobile app users. Cmon guys, this just doesn't make any sense. |
So you aren't caught off guard (I respect you guys), here's my Medium article. |
@jfirebaugh @1ec5 , does mapbox have support for offline tilesets now? also is there a way to add markers on offline maps, I'm able to store tileRegions and use layer via hosting custom styles though having a bit difficulty in adding layers on the fly or maybe manipulating layers on the map(marker layer or tileset layer), is it even possible on offline maps? |
I just discovered how powerful a Mapbox Tileset (Studio) can be and I'm adding it to my map via a
MGLVectorSource
(de-attached from a base Style layer (styleUrl) so I can retain the data source between map style changes or switch to raster map layer).MGLTilePyramidOfflineRegion
only supportsstyleUrl
seemingly only being able to download a base Style layer. Which I guess means that if I want my Tileset available for offline use I need to bake it into my custom Mapbox Style which isn't convenient.Shouldn't it be straightforward to support downloading a Tileset for offline?
Platform: iOS + Android
@1ec5 @jfirebaugh
The text was updated successfully, but these errors were encountered: