I have a MKPolyline that I want MKMapkit to give me the turn-by-turn directions.
I know there is a way to get all the possible routes from point A to point B, but in my app I need to be able to provide turn-by-turn directions of route with certain restrictions:
Has to go through a certain street.
Avoid certain streets
Avoid lights
Take some detours, for sightseeing.
So is there a way to ask for trun-by-turn directions with restrictions?
Or can I ask turn-by-turn directions of a specific polyline that I know?
The Apple directions API (MKDirections / MKDirectionsRequest) can give you directions from point A to point B, but does not allow any other restrictions to be placed on the route.
The Google Directions API (not part of the Google Maps SDK, but can be used through standard HTTP requests) does allow more restrictions, but not to the level you require.
It does allow you to add up to 8 waypoints, so this would allow you to specific specific streets or detours in the directions request. It also allows you to avoid toll roads or motorways. It does not allow you to avoid certain streets or lights - I don't know of any directions API that has that level of detail.
One other restriction of using Google Directions API is that you must show the results on a Google map.
Related
I am working on a project that involves computing a custom route from a particular origin position to a destination on a map. Ideally, this application should be able to give live walking/driving directions for this custom route, or it should able to send this route to the Google Maps or Apple Maps apps to handle the navigation.
Is there a way to accomplish this using the Google Maps SDK or with Apple'sMapKit (or any other framework)? In theory, for short routes, this could be accomplished using the Google Maps waypoints feature, where points along the desired route are pre-specified, but the API is limited to 23 waypoints, which would become problematic quite quickly.
In essence, I want something like Google Maps, but with the route determined by my own algorithm rather than Google's.
For custom routes, you could use something like Skobbler or MapBox.
I'm making an iOS app that needs to be able to find the most populated cities within a radius from a certain point, and to calculate a route that passes through a certain number of those cities, that satisfy a certain time constraint. I'm planning to use Google to give me polylines that I can put directly on an Apple Map in the Mapkit for Xcode. I've looked into the Google Maps SDK for iOS, and Google Places. Google also has a Directions API, and a Distance Matrix API. With so many API's, I'm slightly confused about which one I should use, and for what.
Additionally, do Google API's provide city population, or should I find that via another database?
You can use Google Maps URL Scheme to get directions for Google Maps iOS.
If you are ever confused about which API to use for Google Maps, you can use API picker.
There is no Google API that give city population, so you would need to find it with a another database.
I need to implement street view, but it seems that google does not have that capability for India.
I want that The map should be dynamic and the customer should be able to see point of interest near a specified point and within a given radius or zip code.
I need to geocode and reverse geocode
Can somebody share an idea and one quick example of this.
if you want to get places of interest near by some location, then I would suggest using HERE PLACES API for that task. The site should also include nice examples for the API. Also its simple REST API, so it would work in any platform really.
I am working on my app, it has the mapView inside and the user location. Then, I need to get direction from user location to particular place on the map, how do I do that. I'am searching around and it seem to be like that Apple does not allow to do it on Apple map.
Please give me some advices and thanks so much.
As John commented, you can't get directions via a UIMapView, as Apple doesn't provide an API you can use to do so. If you really need an API for directions and don't want to write it yourself, check out the following APIs:
MapQuest
CloudMade
Google Directions Web API
Using one of the listed sources, you can make an HTTP request to a server that will return a result (likely in JSON) that includes both directions and an ETA.
For example, the following MapQuest API call will return a JSON item called distance, which contains the formatted distance (in miles) that the recommended route between Lancaster and York will take. Just remember to pass in your API key.
http://www.mapquestapi.com/directions/v1/route?key=YOUR_KEY_HERE&from=Lancaster,PA&to=York,PA&callback=renderNarrative
For further explanation, have a look at the MapQuest documentation.
How to show the Route path from one place to another place using bingmaps in WP7?
i am having user starting latitude,longitude and destination latitude,longitude values...
Please tell me....any samples please let me know...
thanks in advance
It will depend on your needs and if you wish to customise your "Map".
There are two options available:
Use Bing Maps Direction Task - (very good, quick tutorial)
Use the Bing Maps control in your app - (you will need to sign up for a developer account, then follow the tutorials on how to call the various services to get route information based on start and end points and then finally show them on the map)
number 2 is more challenging, however will offer much greater levels of customisation