Search code examples
iphoneiosgoogle-mapsdictionaryios6

How to achieve density/heat map effect in iOS (iPhone/iPad)?


http://www.econguru.com/heat-map-of-worldwide-gdp-ppp-per-capita-2008/

This is CIA world Factbook map, each country has different color depth based on their GDP number. High GDP country has deeper color.

Right now, I am considering to develop such effect into my iPhone/iPad map app. I may want to use the apple map (probably not google map since iOS 6 has its own map), but I am not sure how to get such effect based on the country the user visited.

For example, the user visited US the most, then the map shows deeper color in US.

I haven't seen such effect in iPhone app yet. Any suggestion would be appreciated!


Solution

  • This should be doable using MapKit and overlays. You would need to construct an overlay for each area of the heat map and then set the color according to the data. I suspect the hardest part is going to be getting the geographic data you need to construct the paths for each region. AFAICT, there's no -pathForState: or -pathForCountry: type of functions in MapKit, so you're going to need to find another source for that information. But in terms of drawing overlays, it's all there in MapKit. Check out this sample code.

    EDIT:

    This question has some pointers on where to get that data.