Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Access token method is missing #2

Open
SeanChristopherConway opened this issue Sep 29, 2016 · 5 comments
Open

Set Access token method is missing #2

SeanChristopherConway opened this issue Sep 29, 2016 · 5 comments

Comments

@SeanChristopherConway
Copy link

In order to use mapbox api URLs there needs to be a method for setting the access token, otherwise:
[ERROR] : TiApplication: (main) [122,4253] Sending event: exception on thread: main msg:com.mapbox.mapboxsdk.exceptions.InvalidAccessTokenException:
[ERROR] : TiApplication: Using MapView requires setting a valid access token. Use setAccessToken on Mapview to provide one.

I would set it here in the handleCreationDict function in MapViewProxy.java:

    // Handle creation options
    @Override
    public void handleCreationDict(KrollDict options) {
        Log.e(TAG, "***** handleCreationDict");

        super.handleCreationDict(options);

        if (options.containsKey("styleUrl")) {
            styleUrl = TiConvert.toString(options.get("styleUrl"));
        }

        if (options.containsKey("accessToken")) {
            accessToken = TiConvert.toString(options.get("accessToken"));
        }

@caiocost
Copy link

is there any news on this?

@SeanChristopherConway
Copy link
Author

This module is already pretty out of date. It is not using the MapboxAccountManager to manage authentication which is now necessary. Personally I have updated it on my own fork to allow this and because the newest build allows for offline styles in JSON format to be read from a local file source. Perhaps I will push or start my own module.

@caiocost
Copy link

thanks for the quick answer! im looking for custom map such as mapbox or osm to use on both iphone and android, but i did not find any titanium module for OSM and no module that supports accesstoken that seems to be necessary to use tha API...

@SeanChristopherConway
Copy link
Author

SeanChristopherConway commented Feb 1, 2017 via email

@caiocost
Copy link

caiocost commented Feb 1, 2017

hello @SeanChristopherConway i think i'm not. i was looking fot an online API like google maps...

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

No branches or pull requests

3 participants