Google Maps native directions iphone MKMapView - iphone

Can I to open a MKMapView with directions from multiple places. I do not want to call the google maps api where it will open is a separate window. I want to place info on the stops if possible.

Sure you can.
My suggested starting sequence for achieving this is:
Read up on MKOverlay, MKOverlayPathView and related MapKit classes.
Fetch the directions in a background thread from a provider (eg Google API). This doesn't open in a separate window, you can do it all in background with some API calls. Parse the results into a local model for your stops.
Show your map view, and generate overlays from your directions model data.
You'll add Annotations for your stops, and they will have "callouts" so that the users can view some details about them. I believe there are plenty of examples readily available that demonstrate how to do this.
I hope this very general answer is of some use, perhaps just to let you know that what you want to do is readily achievable, and doesn't require much code.

you can request directions from one of the APIs available (Google,...), parse them and draw them as overlay on your MapView, but I recently stumbled over a commercial framework which saved me a lot of time and hassle:
http://mtdirectionsk.it

Related

Supply path data to OpenStreetMaps or Bing Maps

Bing is comprehensive and it isn't Google. Also I was given to understand that Bing maps integrates OpenStreetMaps data. An answer for OpenStreetMaps would also be acceptable; it's the capability that matters: construct a URL that causes a browser to show a path on a map.
I don't want to embed Bing maps as a control in a web application. I want to construct an HTTP request (GET or POST) to launch Bing maps in its own right in another tab or browser supplying a small series of points (probably GPX format) to be shown as a route on the map.
It's the structure of the URL (and payload if applicable) that interest me. If you want to put code in an answer Javascript, Typescript or server side C# are all no problem.
When I research this I find loads of info on using an API to request a route between two points. This would be fabulous if I were trying to create yet another nav app but the requirement here is simply show this series of points as a path on a map.
I can do it for a single point (sample lifted from another question's answer) https://www.bing.com/maps/?v=2&cp=53.0210235~-1.48398532&lvl=16&dir=0&sty=c&sp=point.53.0210235_-1.48398532_My%20Phone
The Microsoft APIs documented here all require a registration and key because they're intended for Enterprise applications that support embedded maps in branded apps with the enterprise paying for use.
My application is FOSS and is intended for a private individual to plonk half a dozen points on a map in the course of trying to figure out where a phone was lost without consenting to being tracked by Google or a phone manufacturer.
The example above launches Bing maps and passes a point. Is there some kind of URL based way to get Bing maps to launch in its own right - not hosted in another app - and show a series of points for display as a path? If so, what search terms should be used when looking for details? The answer from which I lifted the sample has a link but it no longer produces the docs.
If you want to just open the bing maps website with some information drawn on the map, the documentation for that is here: https://learn.microsoft.com/en-us/bingmaps/articles/create-a-custom-map-url
To draw a polyline on the map, take a look at the section titled "collections" which describes how to add points, lines, or polygons to the map. As a quick example, this URL will create a simply polyline: https://bing.com/maps/default.aspx?sp=Polyline.47.68_-122.12_48.68_-123.12_49.68_-122.12_LINE_some%20notes_http://bing.com__%2300ff00__4px_Single_Solid

Draw route in Apple map in ios 6

I want to draw a route between two places. I have the GPS value of those places. I can get the GPS route values between those places from the google api http://maps.google.com/maps?output=dragdir&saddr=&daddr=.
I want to know that will google reject my app. Because I found that "the Directions API may only be used in conjunction with displaying results on a Google map; using Directions data without displaying a map for which directions data was requested is prohibited. Additionally, calculation of directions generates copyrights and warnings which must be displayed to the user in some fashion. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions"
Ple give me clarification on this.
You may not use the Google Maps API unless you use it with a Google Map. To use the direction data you would have to use a UIWebView with a javascript based Google Map.

How to display graph in iPhone Application

I m new in iphone..I create Application in which I maintain data About Income ,Expenses, & total balance .I need to display that information in Graph..
Question:- How I display graph in my Iphone application???like suppose If total balance is 1000 and income is 500 then In graph It displays overall graph contains total balacne means 100% and income will Be display as its 20%
Now I get the graph in my application BY using CorePlot But I provide static data ON Axis..I want to display Data from Database.. How can I do that??
Instead of using core plot or an google api that needs an internet connection you can draw a graph yourself using quartz 2d. That's what I did for my app. CorePlot was kind of tricky to install and it seems complicated for small projects.
http://buildmobile.com/creating-a-graph-with-quartz-2d-part-3/
The advantage of drawing the graphs yourself is that you learn to use the standard drawing apis from Apple. Good luck
The easiest way is to use google chart api, I use this in all my apps.
see the tutorial here,
http://code.google.com/apis/chart/image/docs/making_charts.html
you will directly get image as per your requirement just by making one HTTP Request.
I used Core Plot, it's easy to use and there are samples for almost all the graphs...
If you want to draw graphs in iPhone applications using Objective-C or Swift, you can use SciChart, which supports over 20 popular chart types, including Column and Bar.
There are some really nice examples over at the scichart website for drawing chart types in Objective-C and Swift.
For instance:
iOS Column Chart Example
iOS Stacked Column Chart Example
iOS Bar Chart Example
Examples are also hosted on Github and there are also tutorials to help you learn this powerful tool.
.
As a disclosure, i am the tech lead on the scichart project

Displaying nearby businesses in mapkit

Is it possible to display nearby businesses in mapkit? If not, how else can that be done?
Is there a way to display by category - restaurant, retail, museums?
Also, I don't think displaying traffic flow is available. Can anyone confirm?
The current version of MapKit does not support such features.
It's main capabilities currently are:
a scrollable/zoomable map
reverse geocoding (get the address for some given lat/long coordinates)
add annotations (pins) at a given lat/long
show phone's current location
show Standard, Satellite, or Hybrid view
To display nearby businesses, you would have to:
query a third-party for that information which would ideally return lat/long coordinates
add annotations to the map using the returned coordinates
This is an interesting and emerging business idea!
I live in Nordic region and there is an open Mashups especially for sweden.
By open i mean, any one can request and get access to the content to find nearby Cafe / WiFi / Sushi restaurants etc..
BEGIN PLUG WARNING
Check my iphone application which fetches content from the mashups and display using MapKit!
END PLUG WARNING
And there is a commercial content provider called Info24 for nordic countries at the moment.
Like DyingCactus said, it's not currently possible without using your own calls to one of the mapping service providers. There are options available, though.
One of them is CloudMade. They have a good iPhone library and support almost all of your requirements.
Check out the API at Cloudmade.com
I know this thread is kind of old, but i figured out a free alternative to do what you are looking for, more or less. You just nee to tap into a maps.google.com service and get a kml or JSON output. I used KML (XML) becuase i found the filesize to be consistently smaller. I wrote a 3 part series on my blog about how to do this for anyone that is interested.
http://www.zen-sign.com/finding-business-listings-and-displaying-with-mapkit-part-1/
http://www.zen-sign.com/finding-business-listings-and-displaying-with-mapkit-part-2/
http://www.zen-sign.com/finding-business-listings-and-displaying-with-mapkit-part-3/

How does Urbanspoon display map?

I've looked at Google's map API, which is all javascript and terribly slow on the iPhone. I then tried using the link option available at maps.google.com. That is fast but I can't see having much control over it. It also displays a little search box at the top of the map. Google's API says you must use maps in a website, which the iPhone isn't. I'm not sure about licensing for maps.google.com.
Urbanspoon's scope option does everything I want with maps in regards to displaying nearby businesses based on your location. Given the limited set of tools available for Google maps without mapkit, I don't know how they are doing it. It looks as though they have somehow integrated with mapkit. Clicking an annotation shows the callout and another click pushes a new view with details from that pin. Any ideas how this can be done?
-- EDIT --
Just to be clear, mapkit doesn't display surrounding businesses. That's the crux of the problem and I'm not sure how Urbanspoon got past it.
You can also use the Google AJAX Search API: http://code.google.com/apis/ajaxsearch/
It's a Javascript library, but for Flash, and other Non-Javascript environments, the API exposes a raw RESTful interface that returns JSON encoded results.
And within this API, what you want is the 'Local Search' if you are looking for nearby businesses based on the location.
Urbanspoon probably gets the data for the locations of nearby businesses via some other method than the MapKit API.
Then its likely that they use the MapKit API to display custom MapKit Annotations at those locations.
If you are looking for a business data provider you could look into yelp's API.