How to create get direction button in mapView? - ios

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.

Related

get country and city information from wikimapia Api

I need to know in which country (and hopefully some more info, like city or area or state and it would be great if I could get whether this is on land or sea) a coordinates set lies in.
I have tried the wikimapia api but it is extremely difficult to get around to it.
for example I have this call
http://api.wikimapia.org/?function=box&key=example&bbox=23.72251,37.96918,23.73094,37.9731&format=json
which brings some information about an area in Athens, Greece.
The problem is that not only this api call is depreciated, but when i try to get the country by adding &category=2977
http://api.wikimapia.org/?function=box&key=example&bbox=23.72251,37.96918,23.73094,37.9731&format=json&category=1176
this doesnt work(the category id i got it from this gist)
I would guess that this might have something to do with the method being depreciated, but when I change to the new method place.getbyarea it is not working at all.
http://api.wikimapia.org/?function=place.getbyarea&key=example&bbox=23.72251,37.96918,23.73094,37.9731&format=json
Any ideas? thanks in advance
Why do you want specifically the API of Wikimapia to get your information? To recover the city and country from GPS coordinates, some others API’s are much more appropriate I think, here some examples:
Google Maps (used here in a webpage)
Here Maps
Bing Maps
Apple Maps (Mapkit.js)
Algolia Places
OpenStreetMap Nominatim

Get Popular Locations close by - Google Maps/Places SDK for iOS

I'm investigating how and if there is a way to get a list of popular locations near you (or within an area) using the Google Maps/Places API. Please see the attached screenshot for what I am referring to:
You'll notice the "Popular Locations in Toronto, On" section. Is there a way to get a list of these by passing in your current location, whether that be with coordinates or simply an address? I'm trying to understand how this was achieved in the above screenshot. Any help would be greatly appreciated. Thanks in advance!
You can use this web service api
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=(latitude),(longitude)&radius=5000&key=(api_key)
to get all the nearby places. It also contains mechanisms to filter, keyword, etc.
You can check out this link https://developers.google.com/places/web-service/search to see a list of required and optional parameters that you can pass additionally.
In case you want to use native iOS sdk https://developers.google.com/places/ios-api/start this is a good place to start.

Need help on geolocation API

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.

Tweets, Location, Keywords and Data

I'm trying do some analysis on locations where people are going during winters. The approach I'm following is get tweets from a specific city (say, New York) and with the keyword Foursquare. Then use foursquare data for that user to see his/her checkins and try to trace a pattern.
So, I'm stuck in the first phase. How do I get those tweets from ONE city and with the keyword FOURSQUARE. I'm not sure if I understood how to use streaming API correctly and the ReST API isn't working (shows NOT AUTHORISED)
Could you tell me a detailed procedure for a rookie to understand the process of doing the above mentioned process. Also, let me know if you have a better approach for analysing trends in check ins.
Thanks
You want to read these:
https://dev.twitter.com/docs/api/1/get/search
https://dev.twitter.com/docs/platform-objects/places
You can give Twitter a latitude/longitude coordinate and a radius, or you can use the "place" field as a filter. Either way, expect to fine-tune this a bit to fit your needs. You also need to take into account that a lot of people might tweet without location services enabled.
If you want to use the REST API, you need to get an API key from twitter.

Route Map Direction on Bing Maps in Windows Phone 7?

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

Resources