首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在地图上的特定位置搜索特定方面

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

Stack Overflow用户
提问于 2015-01-19 08:58:21
回答 1查看 23关注 0票数 0

我如何编写一个函数来与苹果的MapKit交互,以便当给定一个特定位置(纬度/经度)时,程序将在该地图上搜索半径为5-10公里的某些方面?

例如,给定一个机场的地理位置,并搜索该机场半径内的跑道,然后放置标记跑道的向量,以查看跑道的特定位置。

我该如何去编写这样的程序呢?

EN

回答 1

Stack Overflow用户

发布于 2015-01-21 12:06:00

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

代码语言:javascript
复制
// 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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28016576

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档