how to create customer map on iPhone without using Google Map - iphone

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

Related

Getting routes and turn-by-turn navigation in an iPhone app

I'm developing an app that will focus heavily on giving users routes and turn-by-turn directions while driving. It is important that they stay within the app during their drive, so I really don't want to make them leave the app and go to the built-in Maps app. I have been doing a lot of research lately on how to include this functionality, and it is widely known that it is not easy, since Apple doesn't include this functionality in the SDK out of the box. It looks like my options are:
For providing routes (and directions) from one place to another
Use a UIWebView and load some web-based maps with JavaScript, and use the JavaScript API to draw a route
Use MapKit or the Google Maps iOS SDK, query for the route sepaartely through an API, and manually draw some kind of path or polyline on top of it.
Use a library that costs money (like MTDirectionsKit)
For providing turn-by-turn navigation
Use a proprietary library that comes with its own maps (like CloudMade)
Is there anything I'm missing here? What are the pros and cons of each, and how should I pick a solution?
Your insight is greatly appreciated. Thanks!
You say that you don't want to "make" the user leave the app and use the built in software for turn by turn navigation as though this is a bad user experience. A bad user experience would be getting forced to use a turn by turn nav from a webView or some API which would not show up as routing information on my lock screen if I lock the phone or cut into other applications to display banners telling me a turn is coming up, for example, while I'm listening to music on my phone. I strongly suggest you launch Apple maps and let the system handle what it is meant to handle instead of trying to build your own turn by turn navigation and heavily limiting the user from the freedom of exiting the application during a drive.
While on the subject of commercial libraries you might what to take a look at other options:
skobbler/telenav sdk - in-app routing and turn-by-turn navigation based on OpenStreetMap (same maps used by Cloudmade and Mapquest). Check out the demos and the licensing plans and figure out if it's the correct solution for you
(they have a Free Tier that might be good enough for your app - and if you go above that tier I think you should be considering monetizing you app)
and that's about it for the time being (besides the options already named): keep an eye out for Mapbox as they could provide an iOS sdk in the near future - with routing and navigation
I agree with Kris' response. Turn-by-turn navigation is probably best handled by the built-in app. However, for displaying a route and ETA on a 2D map, I think I'm going to go with the Mapquest iOS API, which offers this functionality for free. I didn't know this solution was available until today.

iOS Mapkit - Cache maps?

I need maps of certain areas available when no internet connection is available.
It would be like this:
User loads app internet connection is available
App downloads list of coordinates and places pins on the map
User leaves their house and has no internet connection
Pins and map remain readily available for user to interact with, even without internet connection
How do I do this?
You probably won't use MKMapView and MapKit for that, but the Google Maps Static API that allows you to download static images (even with pins on it) directly.
Here is the example given by the Google Maps API doc itself
Then you can store this image and display it in an UIImageView in a UIScrollView for example.
Possibly the above mentioned Google API achieves just this, but another approach is to create a KML file using Google custom maps or some other service and then download and display it. An example can be found here. Alternatively, MapBox has this functionality built in. Go to this webpage, click command-f and search for "offline", and you will find the relevant information. One last suggestion- as an inelegant hack, if no other option works, you could try saving the html of the google maps webpage for the area and then loading that html file from your main bundle into your map view. I have no idea if that would work, but in a last case scenario it would be worth a shot.

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).

Force MapKit use cached map tiles only/disable network programmatically

We have stumbled upon such a problem.
We are developing an application for travelling. To make sure the user doesn't spend much money on roaming charges in our app we decided to implement a settings option for user to view cached maps only. So we let the user decide whether he wants to load the maps from internet or he wants to save money and view cached maps (stored in Library/Caches/MapTiles/MapTiles.sqlitedb).
We can't find a way to implement this. Is there any way to disable network programmatically in this case? Or force MapKit use cached tiles only? We thought about changing APN programmatically for this option to force MapKit go offline. Is it possible to change APN programmatically?
Thank you!
iPhone SDK apps do not have access to the network adapter settings, and I know of nothing in the MapKit API that gives you control over its Internet usage. Your best option in this case is probably to present an alert suggesting that the user enable Airplane Mode or turn off data roaming.
use openstreetmap
think the commercial side of it Cloud-made allows offline maps
http://developers.cloudmade.com/projects/show/iphone-sdk
Libraries that help iPhone developers use OSM maps
route-me is an open-source library used in a number of iPhone applications to display OSM maps.
The CloudMade iPhone Maps Library is an open-source library that provides high-level access to CloudMade's OSM-based map tiles with different sizes and different styles.
John McKerrell has ported the routing algorithm from gosmore to run on the iPhone and has successfully generated basic routes. More complicated routes crash the iPhone at the moment
There are some ways. One is to use your own tile overlay and implement the caching algorithm either in URLForTilePath: or in loadTileAtPath:result:
It works very well with open domain and some private ones. Does not cache the standard Apple Maps.
Another way that will be able to cache everything is subclass NSURLProtocol. There are some tutorials and probably you may detect when is a map image and act accordingly
the google map app does the cache feature ... MapKit seem no , I think Apple will add this feature in next version SDK ...

What's the best way to do a mapping application for the iPhone

So I'm looking at writing an iPhone application that shows things on a map. What frameworks/methodologies are out there for doing this?
Searching around on Google, I could only find this one:
http://code.google.com/p/iphone-google-maps-component/
Which according to the issues list is slow, and stops working after a while. Does anyone know of something better, or have any experience with the library above?
I'm pretty sure your only options for now are:
Call openURL: to switch to the Maps app
Use the Google Maps component you linked to
Roll your own thing
Wait for Apple to expose a "MapKit" framework
WARNING: Embedding Google Maps inside an application may violate the Google Maps terms of service.
I have written a full mapping UIView on the iPhone (the application is on the AppStore) and it is not easy (this would be option #3 "Roll your own thing"). Getting good performance is really difficult. I would like to OpenSource my map component but right now the F-NDA is preventing that.
I have been chasing this for a while now, and here's the best solution I've found out there:
http://code.google.com/p/touchcode/
There is a component in there called TouchMap and it comes with a demo that shows it off. It's tiles are loaded directly from Microsoft Virtual Earth.
Edit: #schwa, I just a look at your profile to find your email address, and then realised that you actually released this software. Nice work
I've just found route-me which looks like a large(30+) active community of ppl developing an open source mapping app for the iPhone. It can take tiles from OpenStreetMap, Virtual Earth(Bing) or Cloudmade.
just use mapkit framework.really good
alternatively: [[uiapplication sharedapplication]openurl:#"www.maps.google.com];
that will open the google map,but one problem with this is that it will navigate you to safari and your application will be exited and if you want to move back to your application from this web page,then it won't be possible .you again need to run the app.