-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fixes #892: support mapbox:// style URLs #1161
Conversation
As far as I can gather, we don't need to set a |
mbglMap->setStyleURL(std::string("asset://") + [filePathURL UTF8String]); | ||
std::string styleURL([styleURLString UTF8String]); | ||
|
||
if ( ! [[NSURL URLWithString:styleURLString] scheme]) |
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.
Can we drop this case and require the app developer to use "asset://..."
if that's what they want?
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.
setStyleURL:
is private right now. At such time that we support in-framework setting of a style URL (versus download of JSON externally and passing that) I think we could, but also, it's weird to use asset://
— this has no meaning outside of GL and typically a Cocoa dev would use +[NSURL fileURLWithPath]
.
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.
It may have no meaning outside of our codebase, but we use to to make our styles compatible across renderers.
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.
Right, no qualms with it, I'd just rather not expose the scheme to end users if we can avoid it.
Yes, they should be using |
Ok, I'm going to merge this then once CI passes. |
👍 |
fixes #892: support mapbox:// style URLs
Can you please add tests for this? |
Will do. |
Tests done in #1167. |
Addresses #892 and ports over mapbox/mapbox-gl-js@699826a.
This lets the user continue to pass a bundled style like
styles/emerald-v7.json
from Cocoa, which will get converted into anasset://
URL as before.But if a style URL like
mapbox://justin.80b0e36d
is passed instead, it gets converted to the style API format and loaded via the regular remote style URL facility.One thing I'm not clear on:
base
should be inStyleInfo
. Does this matter for URL-based styles @kkaefer @jfirebaugh? Going to keep digging into this but can't quite figure it out yet.