Show traffic like in Maps app from iphone using MKMapView - iphone

I've noticed that the maps app integrated in iOS can show the traffic, but is there a way to do that using MKMapView? or that functionality only appears in that app?.
Any help please?

The data Apple uses appears to be sourced from TomTom and others. If you can find an API that provides traffic data, you can use a MKPolyline to render the data.

As far as I know you can't show the traffic information using the MK framework.
To achieve the results you want I would offer to use the third party resources, Google Maps API for example, and use UIWebView to present a customized map. Google Maps JavaScript API v3 TrafficLayer

Related

iPhone: Using Google to get directions

In order to get directions, Google provides this nice URL:
Sample here...
How can I use the information that Google provides to get the same direction line on a MKMapView in an app?
You will have to either use a web view with a Google map, or draw on the MKMapView with overlays. There are a couple of projects on GitHub that do this:
https://github.com/kadirpekel/MapWithRoutes
https://github.com/kishikawakatsumi/MapKit-Route-Directions
In iOS 5, you can also open the maps app using an openURL call to the link you specified, and it will give you multiple possible routes to the location.
Unfortunately, the way to do it with the built-in MKMapKit is to calculate the route using some webservice then using MKOverlays to render that line. Those tools suggested by neven are probably a good first start.

how to create customer map on iPhone without using Google Map

I'm trying to integrated in our iOS app. Due to the bad relationship between Google & our government, Google Map is not a good idea.
We have bought a local map service company's javascript & Web Services based SDK, now we want to use it on iOS. But it seems that MapKit does not support customer tiles.
So here are my current ideas:
Use UIWebView. But I tried that map in Safari, I can't drag to move the map nor use two fingers to zoom. I think I need to call some javascripts while touch events happens.
Build a costumer UIScrollView, download map images and display them using iOS sdk. But that map service does not have API to download images, I tried to read their 200KB+ undocumented javascript to find out the relationship between location & image files, but I got no results for now.
Both the two ways could face certain legal risks. I'm not sure what the purchase contract is like.
I need suggestions about the two ways or some new ideas. Thanks guys.
There are a couple of non-Google map implementations available on github that you might be able to use (linked via CocoaControls):
NAMapKit
MRMapView

How to implement google maps in my iPhone application

I am totally confused with google maps and maps of iPhone...
i have read that iPhone uses google maps.....and also spent some time on it....
But it never display the items like location pictures, balloons etc.
EDIT
THIS is photo for of browser
and following is same place for iPhone maps
second one did not show the annotation added by people.....
(this is what i was asking for ballons or other pictures which people adds to location on oogle maps)
I want to display all those in my application....
what should i do...
if you suggests implement Google maps API, then please suggest a working link...or provide some sample code if possible.....if anybody has done it...then please mail me at yogeshkumau#gmail.com
waiting for answer......
Points of Interests(location, pictures and baloons) that you are talking about can be shown in your maps, if you acquire the license for Google maps premier api. In that case you'd have to use dynamic maps by using google's web services. However if you want to implement it using MapKit framework on iOS devices, you'd have to draw your custom POIs using core graphics.
Apple has a special agreement with Google to use their maps on their platform. The internet is packed with examples of usage of MKMapView along with annotations (pins, there're no baloons on iPhone).

accessing google maps via UIWebView - illegal?

New to iPhone development. Working on first app. I'm accessing google maps via UIWebView to forward geocode an address using "http://maps.google.com/maps?q=my address". It works, although it has this quirk of requiring you to hit "Back" button and then the "Detail" button (provided by the navigation bar) to get back to the screen from whence you started. If anyone knows why it does this, I'd love to hear. My real question, however, is this a legal use of google maps? Since I intend this app for commercial use, am I violating Google's rules + regs? If it is illegal, what's my alternative? Thanks.
Using Google Maps in a UIWebView is permitted by Google's Terms of Service.
In iOS 6 Apple switched the maps backend from Google to its own, and even though it is technically possible to use Google's map tiles in MKMapView, that is not permitted by Google's ToS.
Here's the clarification directly from #GoogleMapsAPI on Oct 3 '12:
Q: There are some iOS apps using GMaps tiles, so I want to know they are legal or not legal with licence violation.
A: Direct tile access is not permitted. Using JavaScript API in a web view is permitted.
I'm not an iPhone developer and the last thing i know is objective-c, but have you considered using the Google Maps API?
http://code.google.com/apis/maps/faq.html#mapsformobile
It says
The Google Maps JavaScript API v3 has been developed to cater to mobile devices, and is suitable for browser applications targetted at both the desktop and devices that include a web browser with a full JavaScript implementation, such as the Apple iPhone.
For browser based applications targetted at devices not suitable for using the JavaScript API, the Static Maps API delivers map images in GIF, JPG, and PNG formats, including markers and polylines. Note that it is not permitted to use the Static Maps API outside of browser based applications.
I'd surely try it, at least the Static Maps API cos it's extremely easy to use, and the overall agreement allows commercial use.
You might be better off using the Bing API, it's designed to be used client and server side. So you should be able to make a web service request without using UIWebView.
Rich

What KML fields are supported in the native Google Maps application on the iPhone?

I have been doing some research on using maps in iPhone applications and it looks like most of my needs can be met passing KML data into the built-in google maps application, but I cannot seem to set the same values (phone, home page, address) that are available when performing a built-in search in the maps application. Does anyone know if there is any way to set those values, or what fields are available?
UPDATE: With the advent of the 3.0 OS and the Map API, applications no longer need to pass control to the built-in map application, so this question is no longer relevant.
KML is not officially supported by Apple as of now. It's specified in the URL schemes documentation. Any URL in the ?q= parameter will be ignored.
There are few options available for iPhone developers planning to use Google Maps in their software. I've seen sample code and implementations of WebKit that translates gestures to Google Maps loaded inside it, but performance is dismal at best. Doing a static map without a lot of zooming or scrolling is pretty much the only performance-preserving option until a native API is available.
Take a look at Developing Virtual Earth iPhone Applications with Objective-C