I'm having a question on where to store a large image for map overlay.
The image is about 100MB and it can't be downsized or stored online (requirements). I've been thinking using asset catalogs (xcassets) but it seems that it is for icons and images that need to be resized when it comes to different devices. Using it for storing map overlay image may not be most appropriate. I'am wondering if you have any suggestions on where to store this image file.
Thanks!
Welcome to SO. Since this is your first post I'll take pity on you. Normally I'd ask you if you had done any research on MapKit support for overlays.
If you're dealing with overlay images that big you'll want to use MKTileOverlay
. Otherwise you'll likely run out of memory and crash, and even if your app doesn't crash, it will be slow and laggy rendering your overlay at various zoom levels.
The MKTileOverlay
class expects a grid of small tiles that are composited together to make the whole overlay. Further, the tiles are defined for multiple zoom levels, so as you zoom in you get more and more detail.
You give the tile overlay an URL template that it uses to find the tiles. That URL can either point to the internet, or can contain a file URL that points to a set of files on your local device's file system. If the image tiles are constant and ship with the app you should be able to put them in your app bundle.
Take a look at the docs for MKTileOverlay for more information.