我如何编写一个函数来与苹果的MapKit交互,以便当给定一个特定位置(纬度/经度)时,程序将在该地图上搜索半径为5-10公里的某些方面?
例如,给定一个机场的地理位置,并搜索该机场半径内的跑道,然后放置标记跑道的向量,以查看跑道的特定位置。
我该如何去编写这样的程序呢?
发布于 2015-01-21 12:06:00
只要通读一下示例代码,这就是您所需要的:
// confine the map search area to the user's current location
MKCoordinateRegion newRegion;
newRegion.center.latitude = self.userLocation.latitude;
newRegion.center.longitude = self.userLocation.longitude;
// setup the area spanned by the map region:
// we use the delta values to indicate the desired zoom level of the map,
// (smaller delta values corresponding to a higher zoom level)
//
newRegion.span.latitudeDelta = 0.112872;
newRegion.span.longitudeDelta = 0.109863;还有reference。
https://stackoverflow.com/questions/28016576
复制相似问题