Reputation: 51
a general question, is it possible to have a custom overlay (or more than one overlays) above the Google Map using iPhone Map Kit? Thanks for any comments.
Upvotes: 3
Views: 10247
Reputation: 2336
I've had good luck adding multiple layers of image overlays using MKOverlay. Our current app features 13 large image overlays, and performance is still good.
For some good sample code, check out Apple's TileMap sample from WWDC 2010.
Upvotes: 0
Reputation: 199
If you’re interested in rendering images or image tile overlays rather than vector shapes, subclassing MKOverlayView and defining [-canDrawMapRect:zoomScale] and [drawMapRect:zoomScale:inContext:] can do it for you.
I’ve got an example that uses [-canDrawMapRect:zoomScale] to check the local cache and asynchronously handle tile loads (if a tile isn't cached), and then [drawMapRect:zoomScale:inContext:] to handle rendering the resulting UIImage into the CoreGraphics context.
http://github.com/mtigas/iOS-MapLayerDemo
Upvotes: 3
Reputation: 81
when you mean a drawing of Shapes like Polygon an Polyline and things like that you can use MKOverlay (realy good since iOS 4). there are two steps needed: - use "addOverlay" to add one (or more) Overlay(s) 2 use (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id )overlay to make clear wich way the Overlay is presented.
Upvotes: 0