Calculating Scale/Distance from Map Resolution and Map Width

Discussion created by pauldavid66 on Jun 20, 2012
Latest reply on Jun 22, 2012 by pauldavid66
I'm trying to display a scale indicator on a map and can't see any built in functionality to do this like I've seen with other examples like the web api (an inbuilt scale control that you can choose to show).

I want to calculate the width of the current map in kilometres and from what I've read the resolution property gives the map's current map units per Point. If I use the maps width, the resolution and the fact that the map units are in meters (divide by 1000).

NSLog(@"Scale: %f, Resolution: %f, Width km: %f", mapView.mapScale, mapView.resolution, (mapView.frame.size.width * mapView.resolution) / 1000);

Can anyone confirm that I'm understanding this ok? Are there any other factors I need to take into consideration?