我想让我的MKMapView
显示出除了餐厅以外的兴趣点。这有可能吗?如果有,我该怎么安排呢?
我在文档中确实看到了下面的内容,但它真的是全部还是什么都没有?
@property (nonatomic) BOOL showsPointsOfInterest;
当此属性设置为“是”时,该地图将显示餐馆、学校和其他相关感兴趣点的图标和标签。此属性的默认值为“是”。
例如,在下面,我希望加油站展示,而不是餐厅。
发布于 2014-05-14 17:59:03
不可能控制所绘制的特定类型的点。Apple可以添加/删除/更改它在未来地图工具包的任何更新中显示的特定类型。正如您所提到的,您的唯一行动是设置showsPointsOfInterest
。
您可以使用Foursquare或Facebook的第三方place数据库获取类似的感兴趣点,并在地图上绘制它们,但并不能保证结果与苹果所显示的结果相匹配。
发布于 2020-03-10 18:02:56
iOS 13的另一种选择是包括或排除某些兴趣点:
// Includes airports
localMap.pointOfInterestFilter?.includes(MKPointOfInterestCategory.airport)
// Excludes laundry/laundromats
localMap.pointOfInterestFilter?.excludes(MKPointOfInterestCategory.laundry)
https://stackoverflow.com/questions/23648501
复制相似问题