在特定位置的地图上搜索特定方面

时间:2015-01-19 00:58:21

标签: objective-c macos mapkit

我如何编写一个函数来与Apple的MapKit进行交互,以便在给定特定位置(纬度/经度)时,程序将搜索该地图上5-10km范围内的某些方面?

例如,获取机场的地理位置,并在该机场的半径内搜索跑道,然后放置标记跑道的矢量,以便查看目的和跑道的具体位置。

我将如何编写类似的东西。

1 个答案:

答案 0 :(得分:0)

只需阅读示例代码,这就是您所需要的:

// 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