-
Notifications
You must be signed in to change notification settings - Fork 31
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
Upgrade to Mapbox GL-based Mapbox Static API #9
Comments
I am looking to use this library with the non-classic Mapbox style. Is there a quick workaround to use the current code with Mapbox GL? If not, I will be awaiting the update and will implement it the moment it is released. Thanks! |
Hi @SCasarotto, just double checking: are you interested in getting static images for newer Mapbox GL styles, or would you like to display raster, non-GL styles in the Mapbox iOS or Android SDK? If the latter, please take a look at the following examples: https://www.mapbox.com/ios-sdk/examples/raster-styles/ https://www.mapbox.com/android-sdk/custom-raster-style/ |
Nope I have built up a pretty complex ios project on the standard maps but i am looking for the static images for the new Mapbox GL. I was using the mapViews in a UITable how ever that is extremely memory intensive and was going to convert to static images instead (since that is all the maps were function as anyways) . |
Got it. Thanks for the clarification. For now, a workaround would be to call the REST API directly using NSURLSession or NSURLConnection. Here's documentation for the REST API: note the "cURL" example. |
Great that is what I was planning to do.We have some other milestones that are higher on the priority list but when I get back to this if this hasn't been updated then I will start to write my own. If I do write something similar to the current one for the new GL I will be sure to share it with you. Thanks for all your work! |
In case it helps, I dug around and found some code that we're using in an internal testbed application to talk to the Static API. Here's the entire Swift implementation, which does nothing but construct a URL. I recommend using it with SDWebImage. |
Awesome. Thanks I am part way through rewriting this one. (Got motivated haha). Thanks for that information. |
I have no idea how to send you this in the best way to review and add to the git but I got this working:
edit: added the attribution and logo variables |
I would love to walk through what ever standard steps it takes to contribute to this repo and also feel free to clean up what I have with the code you guys already wrote. I kind of enjoyed rewriting it. :) Thanks for the guidence |
Thanks for the code! I think the way forward for this project is to migrate it to RequestKit, similar to what we did in MapboxGeocoder.swift and MapboxDirections.swift recently. That would normally be overkill for a library this simple, but keeping the libraries’ architectures similar will allow us to eventually create a unified library that talks to all of Mapbox’s REST APIs.
Ah, that makes sense. The Static API uses mapbox-gl-native under the hood, so supporting @3x in the API would be blocked by mapbox/mapbox-gl-native#1008. |
Okay sounds great. For now I will be using this code but will keep an eye on these projects to stay up to date. |
Last question, in the api there are attribution and logo parameters. What is the syntax for adjusting those? |
The
|
Right I understand not being able to adjust what they say however you guys do offer whitelabeling as a service in your enterprise plan. In the api it looks like you can toggle them. Is that simply done by adding " {lon},{lat},{zoom},{bearing},{pitch}/{width}x{height}{@2x}/false,false" or something? Also I understand the use of the access token however the examples provided look like :
which lack the |
|
Great thanks! |
Following all the changes in #19, we’re in a good spot to add support for the new Mapbox GL–based Static API to this framework (if it makes sense to combine it with the existing framework). I think it makes sense to support both APIs in some form until the new API supports overlays. The cleanest way would be:
/cc @bsudekum |
Just as a freshness update to this ticket, the new GL-based API at https://www.mapbox.com/api-documentation/#static still does not support overlays. I'm more in favor of sitting on this ticket until such time as they are supported. Keep in mind that https://github.com/mapbox/MapboxTableViewDemo shows an example of using GL native (i.e. the base of the mobile SDKs) as non-interactive map views, including efficiently reusing this in table views, as a way to leverage GL technology efficiently, with support for overlays, too. |
The Mapbox-GL-based Static API now supports overlays with largely the same parameters as the classic Static API, so supporting both APIs simultaneously should be pretty straightforward. |
This is finally happening in #54. |
This library uses the classic Mapbox Static API. We should upgrade it to the newer Mapbox Static API that’s based on Mapbox GL. The new API supports options like rotation and pitch, although it lacks support for markers and overlays.
/cc @friedbunny @bsudekum
The text was updated successfully, but these errors were encountered: