For Chinese maps on iOS 6, it seems that MapKit selects map provider based on your where the device is located. If you're in China it will use AutoNavi maps, and else it will use the default Apple maps. To complicate things, the AutoNavi maps seem to be transformed in the same way that Google's maps on iOS 5 are, whereas the default Apple maps are not transformed.
By transformed I'm talking about the fact that all maps in China are transformed, although this is not true. Rather, some maps in China are transformed, while some are not.
This transform makes it difficult to place annotations correctly on the map since the map is generally offset about 500 meters. Since it's not possible to reverse the transform of the actual map, the solution is to apply the same offset to the annotations.
There exists non-trivial ways to inverse the transform, at least for limited areas. The problem in iOS 6 is knowing whether or not the map is transformed to be able to compensate annotations appropriately. On iOS 5 this problem did not exist since the transformed maps were used consistently.
The Shanghai maps below illustrates the situation (the actual transform offset is not demonstrated).
So, would there be any way of knowing in run-time whether transformed or non-transformed China maps are used? Other ideas for dealing with this?
Edit: Routing network traffic through a proxy in China changes map apperance in the simulator, so the choice of map provider must be based on IP.
You could always use Bing Maps SDK if you absolutely need consistency - that is consistency between iOS versions and between people in USA or China. Although I would recommend sticking with MapKit.
It's about Martian Coordinate Systems.
Check this out:
https://github.com/Mardinate/Mardinate
Couldn't you get geo data from the phone and if they are in china apply the transformed annotations?
Related
I used Google Maps API https://maps.googleapis.com/maps/api/directions/json for drawing route and getting direction, but when its usees increases, we have to pay charges.
I check in iOS and get that we use mapkit's MKDirections but I have a question that
Is there any charges for its uses or any limitation?
If there is no limits, is there any the drawbacks of using MapKit?
Is there any cases when Google Maps API become more helpful?
I don't think either is a stronger offering by map quality alone. However, google maps requires expensive fees if you gain scale where as "MapKit is free forever" so that's advantage by Apple. Additionally, MK won't require a heavy third party dependency like GMaps (12+ MB compiled), so that's another advantage Apple. Where GMaps shines is street view and for directions in less urban international places, for example MapKit directions and local places/businesses are fine in the US but I wouldn't rely on them in Argentina or New Zealand.
Another advantage of Mapkit is that MapKit has a much better integration with CoreLocation and CoreAnimation. The “Follow user location” mode is missing in Google Maps; as well, the ability to add advanced animations to annotations (MKAnnotation is represented by a UIView, while a GMSMarker is represented by a UIImage) can give your app an appealing touch that the Google Maps SDK just can’t.
As you are going to show address and picture on the marker, so Apple's Map Kit will be better option to work with.
Show this for more information about Mapkit
Personally I prefer MapKit over Google Maps because of the better integration in iOS, a more powerful API and the better looking map material. However Google maps is in some (or most?) areas better than Apple Maps when it comes map details and correctness. This might change since Apple is creating new map material at the moment. But it will take some time to create new maps for the whole world.
Apple Maps is free. Its included in the package the customer buys when purchasing an Apple product. There is a request limit. I experienced timeouts when sending about 200 Requests / min (for resolving large amounts of addresses). Your requests will work again after 5 min or something. So exceeding the request limit is not that easy and it won't be "banned" for too long.
I'm developing an iPhone offline map application. I've illustrator map georeferenced (using mapublisher), have geodatabase (http://goo.gl/isw6IP) and parking data (shp/csv).
Requirements:
The map should Pan, Pinch & zoom.
Search addresses and parking (addresses have alternate names too) on map.
Routing/Navigate to parking/address.
GPS Positioning.
App will work offline without internet connection once installed.
Questions:
In which formate I should export the illustrator map, geodatabase & parking data to be used in a iOS app.
Which iOS offline maps SDK is recommened for above requirements.
Few iOS SDKs like Route-ME, MapBox, Alpstein, Altus, Skobbler, cloudmade, ArcGis iOS SDK, nutiteq etc are using OSM data or their own hosted MAP data but I want to use my own illustrator map and all data will be available local for offline use.
I've search alot but could not find any concreat solution. Few links in my research.
http://goo.gl/m9Lp1w
http://goo.gl/IMKF4p
http://goo.gl/gsrv5Q
http://goo.gl/J4Ne5y
https://goo.gl/1wP29H
Same question (similar to what I need) was asked long time ago but without any answer
http://goo.gl/knoA1C
1:
In my opinion, OpenStreetMap is the best one for all-around purposes such as the ones you mentionned: addresses, parkings, routing, maps.
You can answer all requirements with that format. Depending on your project, you may better transform your data in a specific format for each requirement.
2:
You'll probably have to use a few components to match all requirements :
The map should Pan, Pinch & zoom.
Any of the SDK listed will do it.
Search addresses and parking (addresses have alternate names too) on map.
You can query a local database then create markers.
Routing/Navigate to parking/address.
I would recommend GraphHopper
GPS Positioning.
It can be done manually using CLLocationManager. Create a marker (according to the chosen SDK) then update it's coordinates.
App will work offline without internet connection once installed.
That's the main requirement. You have to chose between vector and raster first, then pick the SDK. You'll probably have to make a few transformation here.
I need to pass user's GPS coordinates from the iOS app to the backend server. The iOS Location Services uses EPSG:4326 (also known as WGS 84) but the back end expect them in EPSG:900193
Does anyone have any information on how to transform the lat/long values to EPSG:900193 in the iOS app before sending them out?
My google fu is failing me. Searches didn't come up with anything I could use. Is there are formula, or a library that I can use?
EPSG:900193 is also know as Web Mercator, which was originally called Spherical Mercator
Wikipedia has a formula for conversion to Web Mercator
The Google Maps / Bing Maps Spherical Mercator Projection has additional information, and as does Conversion of British National Grid (WKID:27700) to WGS84(WKID:4326) and then to Web Mercator (WKID:3857)
The links will get you going, the last link has a javascript for conversion, which may, or may not suit your requirements.
Edit: Doing some light reading I found this interesting Java code for WGS84 to Google map position and back and this gem http://spatialreference.org/ref/sr-org/google-projection/
The biggest problem with all of the name changes...are they talking about the same thing?
I recommend you look at the PROJ.4 Cartographic Projections library and its translations to many languages/platforms. For your particular case you may want to look at the Changing Ellipsoid / Why can't I convert from WGS84 to Google Earth / Virtual Globe Mercator? FAQ
it seems that MapKit selects map provider based on the device is located. In China it will use AutoNavi maps, and else it will use the default Apple maps, but their coordinate system are different, China uses a standard coordinate system called GCJ-02, it has GPS offset problem. I want to distinct the coordinate system the Mapkit is current used so i can do something different, is there any idea?
I would recommend using an alternative to Apple's maps such as Mapbox, which is based on open data.
According to this interesting article, there is a C# implementation of a converter here.
Mardinate is the Objective-C implementation of that code. The conversion is not perfect, and China is roughly defined:
You’ll note that the code interprets that anything within China needs this conversion, anything outside of China, doesn’t. And that China is defined as anything between Latitude 0.83 to 56 and Longitude 72 to 138. I think there’s a few countries caught in that rectangle that might object.
It is a pity that MapKit doesn't allow to make the conversion, but I can't seem to find an answer online. Maybe they are just not allowed to do it.
I'm working with a project its related to Offline map application.Because of that I searched for offline map which shows the defined area. I used MapBox for offline mapping. I can add annotation on this map and draw lines.
But my requirement is offline map with routing. I was fed up to find a offline routing library or offline routing engine to embedded to Xcode.
Appreciate if any of you have any clue or sample project/code to implement this
Note : This question is related to my one. No one replied to this as well
Thanks.
Offline implies no internet, the iPhone is still able in most cases to get the users current location from the GPS. That means that you can be quite confidant that you can find out the current location of the user whilst offline.
The problem with offline routing is that the Phone is dumb, it only remembers the x amount of MB of data in terms of tiles to display.
Routing is something completely different, it takes a point A and B and works out the shortest, fastest, cheapest or all of those between A and B.
This takes a lot more then tiles to accomplish, after all if you think in terms of MVC, tiles are just the dump views, they don't know much about what's around them except what's inside of them. It would be the "controller" who would calculate routes, and for that you would need to be in possession of all the data spanning the desired area for routing.
For each mapping service you will find a different route, maybe not in terms of actual path, but in estimated time, effort etc, what this means is that if you have your own maps (offline in a database), it's up to you to use that data, so you should make your own routing algorithm which I'm sure isn't what you want to do.
So what are your options? At the moment this just isn't possible in the scope you want. Even if you had an offline maps database, you still need a routing algorithm.
In offline case also you can get the current location by using only GPS and you can draw overlay lines from current location to the interesting point for that you have to do some calculations
You can make offline routing by using graphhopper library by making graph data which contains (Street names, routes,edges) . Graph data is taken by .pbf file which can be taken by (Use this:http://download.geofabrik.de) and use commands(in Terminal) that was given by (https://github.com/graphhopper/graphhopper-ios/tree/master/graphhopper-ios-sample) to convert .pbf into graph data. Then we can make offline routing with its instruction (All given in graphhopper iOS sample).please refer that carefully. because i have done and finish my project successfully.