I am trying to add an overlay to iOS MapKit in order to show floor plans. However, I am unsure about the best way of doing this. If I add the floor plans by using an MKOverlay, will the floor plans be loaded lazily or do I need to find out which part of the map is being displayed and update overlays thereafter? I also looked at using MKTileOverlay, as it is using lazy loading, but I have the impression that it should be used for completely covering of the map and not only to add to the existing one. Is this correct?
2 Answers
Yes, you are right MKTileOverlay
can cover whole map with tiles and Yes it is using lazy loading.
Use MKOverlay
if you are not willing to replace native look and fill of map. You can also achieve lazy loading for MKOverlay
too.
Note: MKTileOverlay
will not remove your already existing MKAnnotations
and MKOverlay
.

- 22,848
- 21
- 95
- 95
-
Thank you. Is lazy loading used automatically for MKOverlay, or do I need to configure it in a special way? Also, should my overlays be added to one MKOverlayView, or separate MKOverlayView per overlay? – Jorn Oct 06 '14 at 08:13
-
For `MKOverlay` create block or background thread for lazy loading and DO NOT need to create separate, All overlays will be manage on same `MKOverlayView`. – Kampai Oct 06 '14 at 08:52
MKOverlay
is a protocol, not a class. You want MKTileOverlay
as of iOS 7. Things are lazy loaded according to what portion of the map is currently shown.
You might find this useful as a reference on how the tiles are numbered and organized:
https://www.mapbox.com/foundations/how-web-maps-work/
As for covering Apple's map, this will happen by default, but you can also adjust the MKOverlayLevel
used to place it between Apple's base map and labels layer, or you can use canReplaceMapContent = YES
if you want to disable Apple's maps entirely.

- 5,100
- 1
- 13
- 20