Flyover mode in Apple Maps allows AR/VR style interaction. This is not by default available for iOS developers using underlaying MapKit/ARKit technology. However it is possible to test it and the following short video is about this proof of concept – viewing cadastral maps (iKatastr) in VR like experience on iPad . Btw. Flyover mode on iOS 11 has some strange handling of overlays – described here so loading of tiles is little bit tricky. The iOS 10 version was much more better (check the video here)
Updated WMS over MapKit sample code for iOS7 , available on github I have added cadastral maps of Czech Republic, used camera API to set the view and tested, check also WMS on Google Maps SDK on iOS mentioned here
- (void)loadTileAtPath:(MKTileOverlayPath)path result:(void (^)(NSData *tileData, NSError *error)) result
this method is called by MapKit (or better by MKTileOverlayRenderer ) when it needs to draw a tile . It asks for NSData (and error) from x,y,z tile coordinates. In this method you can load NSData either from local cache or from NSURLConnection and pass resulting NSData (when ready) back to MapKit, for example like this (reading from cache)
result ([NSData dataWithContentsOfFile:filePath], nil);
if you do not need to use cache and you do not provide loadTileAtPath method , you can use another hook (callback) that is provided by MKTileOverlay, URLForTilePath:path
- (NSURL *)URLForTilePath:(MKTileOverlayPath)path
this method enables to custom format URL required to load tile, thus you can use WMS HTTP-GET parameters, for example :
if there is neither method in the derived class, then you probably do not need to derive at all from MKTileOverlay and directly use it with initWithUrlTemplate (not case for WMS, but for any other x,y,z sources)
Bad news is that MapKit on iOS7 doesn’t support tilt/pinch in Satellite/Hybrid mode in MapKit on iOS7
Here is a project I have been working on iKatastr2 (SpatialReader) with myVR technology showing terrain model with overlays of OGC WMS services. All from freely available data. Presented at HxGN live 2013
at 39:10 watch myVR multiplatform rendering technology integrated in the mobile app for 3D map visualisation.
Here are also few pictures form HxGN live booth/keynote
I have crafted really simple and quick code at ESA App dev camp for viewing WMS sources. And as few people questioned me on how to do this, I am posting the full code of the MapView component that takes sample WMS service (Ozone) and overlays this above MapKit.
#1. that sample code uses experimentaly MKNetworkKit, which has some occasional troubles. You can replace the download method in WMSOverlayView class downloadTile
#2 it uses simple hash for storing tiles on cache.
Update: be aware as this is not working on iOS7, however in iOS7 MapKit officially supports to disable base layer !
This blog : https://blog.sumbera.com/2011/09/18/how-to-disable-base-google-maps-in-mapkit/ wrote about how to disable Google maps in MapKit. Now with new iOS6 and brand new Apple maps and OpenGL rendering , the question is how to disable rendering of the base maps without using undocumented functions. Removing whole base layer (VKMapView) is possible but cripples touch handling of the overlays. So here is very simple way how to do this without removing VKMapView – just set opacity of the layer to 0.0. This will erase base iOS6 maps .
I have just release iKatastr2 app on AppStore (free) that might be useful for you to look at as it uses WMS sources and custom tile loading on top of google.
App does simple stuff – shows cadastral information by tapping on cadastral map of the Czech Republic.
As all is driven by JSON configuration it is quite easy to render similar information from other sources.
I have participated in the first ESA (European Space Agency) app dev challenge where 5 teams competed on best concept/prototype that will bring GMES data sources to the public on mobile devices. Our team (Czech Republic, Germany, Macedonia) won and each member got iPad 3 . We won not because we were best in terms of the best prototype, concept or presentation, but because we fit best to the criteria imposed by this challenge and each piece of delivery (5 page long document describing concept, presentation, prototype demo) was pretty good and simple enough to be feasible for final realization. Moreover a unique value of mobile devices plus unique value of GMES satellites have been addressed. Full article can be read here : http://www.esa.int/esaEO/SEMIQOBXH3H_index_0.html
MapKit sends duplicate requests for CanDraw. Duplication found is 10 of 20 tiles (full iPad screen) are sent twice. Very interesting is that drawRect in base map does that too (duplicated request is sent from the second running thread )
MapKit is using CATiledLayer underneath
Don’t do copy-paste 2 loops (see MapTile WWDC 2010 sample project from Apple) if your tiles fits exactly to the matrix of the Google tiles
// for (NSInteger x = minX; x < = maxX; x++) {{
//for (NSInteger y = minY; y < = maxY; y++) }}
MKMapRect projected coordinate system used in iOS MapKit is not the same as Spherical Mercator used by Google, Bing and others. However there is a close linear relationship of the resolution in official spherical mercator and scale used by MapKit and that is 0.149291.
this number is constant for this relation :spherical mercator resolution (e.g. used by OpenLayers) * zoomscale (used in MapKit)
zoomscale in MapKit is calculated as : view width / mkMapRect.size.width
that is : spherical mercator width / mkMapRect.size.width = 0.149291 always.
So now any resolution from Spherical Mercator can be directly mapped into the MapKit internal coordinate system (mkMapRect) and vice versa without heavy calculations from mkMapRect to WGS84 and then to Spherical Mercator.