Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find out which type of area you are in from MKMapView

is there any way to determine which type of area you are in from a MKMapView? I.e. if the centre of the map is in the ocean we can tell the user: the centre of the map is above the ocean, or if the map is centred above a green area: the centre of the map is above parkland...

The only way I can think of to do this is to create a screenshot of the visible screen and analyse the colour of each bit by using some method such as this: iOS -- detect the color of a pixel?

However I would be interested to know if there is an easier way that anyone can think of!

EDIT

To make it more clear what I'm looking for, I'm basically looking for a way to turn a section of a map into a top down level for a game, with different areas determined by the areas of the map...

like image 607
simonthumper Avatar asked Oct 21 '22 14:10

simonthumper


1 Answers

A CLPlacemark has a couple of properties: inlandWater and ocean which tell you when the placemark is in water. I think you can get a placemark from the geocoder.

It also has areasOfInterest which will give you parks and landmarks.

like image 79
nevan king Avatar answered Oct 27 '22 10:10

nevan king