SetVisibleMapRect always goes to arctic ocean
I am using monotouch to develop an app for the IPhone that needs to be able to locate a place on a mapView to zoom in on. SetVisibleMapRect seems to be the right method but I always end up in the middle of the arctic ocean no matter what values I pass in. Am I doing something wrong or am I just using the wrong method for what I am trying to do?
map.SetVisibleMapRect(new MKMapRect(new 开发者_如何学运维MKMapPoint(39.0044444, -76.8758333), new MKMapSize(1000,1000)), true);
The SetVisibleMapRect
method takes an MKMapRect
which uses MKMapPoint
units. These are not the same as latitude, longitude, and meters.
You probably want to use the SetRegion
method instead and create an MKCoordinateRegion
using the FromDistance
method.
精彩评论