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

iOS API equivalents of -js APIs #1169

Closed
kristfal opened this issue Apr 1, 2015 · 2 comments
Closed

iOS API equivalents of -js APIs #1169

kristfal opened this issue Apr 1, 2015 · 2 comments

Comments

@kristfal
Copy link

kristfal commented Apr 1, 2015

Hello,

probably more of a question rather than an issue, feel free to close it if it's in the wrong place.

Been working with the -js client for a while (which is really awesome), and has just started looking at the native iOS client.

Do the native client support altering layers on the fly in a similar fashion to the -js?

Been looking through this, but can't find anything that seems to resemble the javascript API calls.

@martinnormark
Copy link
Contributor

I have successfully added layers using a recent version of master using the style methods.

You have to be familiar with the style spec and first add your map ID to sources and then configure the rendering in layers.

If you want to do it on the fly within the app, you have the manipulate the NSDictionary fetched using getRawStyle and then call setRawStyle which updates instantly.

That was very ugly, I'm not sure if setStyleOrderedLayerNames will add layers or just re-order? It doesn't seem to be in the header file, though...

You can also take one of the current styles bundled in the repo, change it and use that instead of the named one by calling setStyleJSON or setRawStyle if you load it into an NSDictionary.

@kkaefer
Copy link
Member

kkaefer commented Apr 1, 2015

We'll add an explicit API for altering styles eventually. Duplicate of #837.

@kkaefer kkaefer closed this as completed Apr 1, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants