Mapbox iOS Avoid Motorways / Highways - ios

The Mapbox web directions API supports avoiding motorways Link.
How is this done in the Mapbox iOS SDK?

The Mapbox Navigation SDK for iOS uses Directions objects to provide directions between waypoints. You may provide a RouteOptions object to each Direction to specify criteria for the results returned by the Mapbox Directions API. As noted in the changelog for the SDK here, on the RouteOptions object there is a roadClassesToAvoid option where you can specify a RoadClass object to avoid, such as motorway. The source code for the motorway RoadClass can be found here, namely:
public static let motorway = RoadClasses(rawValue: 1 << 3)
The Nav SDK's NavigationRouteOptions extends RouteOptions. So, to calculate directions avoiding motorways in your iOS app, you should specify the roadClassesToAvoid option on a NavigationRouteOptions passed to Directions.shared.calculate. This example for a basic navigation app is a great place to get started.

Related

MapBox Map integration

I am new to map box and I want to have a customised map for my application, I have gone through all the guides of mapBox provided online but they seems to be a bit confusing , I have two things over there,
Create a map using MapBox studio
Integrate a map in your ios application
I just want to know that if I create a map using MapBox studio can I use the same map for my application, plus will the default mapKit API will also work in the same project.
Will the delegate functions of mapKit API works for the mapBox and most importantly, how I can do all the things I am not able to find a example code.
If anyone can provide me with the some example code in which they have integrated a map using mapBox will be really helpful.
Thanks in advance.
It is possible for you to use Mapbox GL to use and integrate in your app. and the delegates for Mapbox GL are provided in their sites and their API will also work for sure, so don't worry give it a try, to have a reference about the example on MapboxGL go to this sites
Mapbox GL example
official site

Integrate GoogleMaps with Mapbox iOS sdk

I'm using MapBox for a iPad app and we want to use various image sources for the map imagery.
Is there a way to get google map tiles and show them in MapBox?
We could construct the url's to get the tiles directly but google will block you if you do this, because we wouldn't be using the official API.
Is there any other option to solve this problem?
It is technically possible, but Google's terms of service don't allow display of their tiles outside of their own software frameworks.

Options for displaying multiple routes on iPhone Map (iOS 4+)

I am trying to develop an iPhone app (with map routing function), and I need everyone's suggestions (guidance).
Below are a few specs:
The app will be running on iPhone with iOS 4+.
The app will have Map functionality.
In the app, given a "few locations" in a given order (to make things less complicated), the Map will draw routes between each locations on the Map.
Clicking on any location will display another page that shows some information about that location.
Can choose alternative route between two location (which I don't think is possible, but let me know if anyone know any framework that can do this).
I did some research, using Map on iPhone is easy using MapKit (and it's available after iOS 3.0). I followed this tutorial, and everything seems easy. However, if I want to draw routes on my map, I will need routes data in a CSV format. However, I do not have those data (yes! I suck).
And prior to iOS 5.1, MapKit use Google Maps, and I read somewhere that in Google Map's term and condition of use, it prohibit people from drawing on the Map (correct me if I am wrong).
In order to retrieve route data, I would imagine that I will have to get it through Google or Apple (I don't know if it's possible). I'm just wondering if Apple Map or Google Map have API to retrieve these?
If not, an alternative I came up with is to use a webview, and display my Map routes on Google Map. I'm just wondering if Google Map API will allow me to insert multiple locations and display all the routes?
I really need some suggestions... I am getting buried in all these problems.... thank you
Follow this sample - MKOverlay is the way to go. One more example is here.

How can i download individual map tiles from the Google Maps SDK (for iOS)?

I've been checking out the new Google Maps SDK for iOS that allows you to bypass Apple Maps for map related features in your app!
https://developers.google.com/maps/documentation/ios/intro
The SDK seems fairly easy to use, but i want to know:
If it is possible to use the SDK (are there API's) to download individual Map tiles?
If so, how?
Ive looked at the documentation given on their developer portal and it says the following:
https://developers.google.com/maps/documentation/ios/map
The key class when working with a Map object is the GMSMapView class. GMSMapView handles the following operations automatically:
Connecting to the Google Maps service.
Downloading map tiles.
Displaying tiles on the device screen.
Displaying various controls such as pan and zoom.
Responding to pan and zoom gestures by moving the map and zooming in or out.
Responding to two finger gestures by tilting the viewing angle of the map.
It seems like the downloading of the tiles happens automatically, or are there API's that allow manual access to the tiles?
If not, any workarounds would also help!
The documentation and header files do not indicate any way to download individual map tiles.
Even if you would find a workaround, you would not be allowed to use it. See clause 10.1.1 (a) in the Terms of Service:
No Access to Maps API(s) except through the Service. You must not access or use the Maps API(s) or any Content through any technology or means other than those provided in the Service, or through other explicitly authorized means Google may designate. For example, you must not access map tiles or imagery through interfaces or channels (including undocumented Google interfaces) other than the Maps API(s).

How to integrate Microsoft Bing Map Navigation functionality to iPhone application?

I have studied about Microsoft Bing Map Navigation. There is iOS support and sdk available at http://www.microsoft.com/maps/developers/mobile.aspx
Can anyone guide me how to use this in my application? My requirement is to create an application having functionality like Google Navigator does, displaying direction using GPS.
You cannot create a turn-by-turn navigation product using the Bing Maps (or Google Maps) SDK. You can use it to generate directions but cannot present any sort of alert for upcoming turns. From the TOU at http://www.microsoft.com/maps/product/terms.html:
Restrictions on your use: We do have some restrictions on your use of the service. You may not:
...
present or alert an end user to individual maneuvers of a route in any way that is synchronized with the end-user’s sensor-based position along the route, (e.g. “real-time” navigation);
...
this project might be a good starting point for what you are looking for:
https://github.com/route-me/route-me

Resources