JoseMartinFit
JoseMartinFit

Reputation: 335

Apple Maps consume too much memory

I need to implement in a view five mapViews of a concrete location (coordinates). I'm implementing the five mapViews in a UICollectionViewController (5 rows, one mapView for each row). The running application it consumes a lot of memory (more than 200mb).

I guess each map loads the whole world, that's a lot of jobs. But what I need to do it's only display the current coordinates I provide, not the whole world. Any idea or suggestion to make the mapViews lighter? Can I only show a map for a concrete region (coordinates) and a radius, without allowing to load the entire world?

Upvotes: 0

Views: 525

Answers (1)

slonkar
slonkar

Reputation: 4085

MapView is expected to take that much memory. MapView is not just plain view, there are a lot of things that goes into creation of mapView instance. For example images and data for location shown on mapView.

For your use case, I would strongly recommend using MKMapSnapshotter. Here is documentation link - https://developer.apple.com/library/mac/documentation/MapKit/Reference/MKMapSnapshotter_class/

Upvotes: 2

Related Questions