仅从MKMapView删除餐馆

问题描述 投票:2回答:2

我希望我的MKMapView显示景点除外餐馆。这可能吗,如果可以,如何设置?

我确实在Documentation中看到了以下内容,但实际上是全部还是什么?

@property (nonatomic) BOOL showsPointsOfInterest;

[当此属性设置为YES时,地图将显示餐厅,学校和其他相关景点的图标和标签。此属性的默认值为YES。

例如,在下面,我要显示加油站而不是餐厅。

<< img src =“ https://image.soinside.com/eyJ1cmwiOiAiaHR0cHM6Ly9pLnN0YWNrLmltZ3VyLmNvbS9xWkx0YS5wbmcifQ==” alt =“在此处输入图像描述”>

ios mkmapview mkannotation point-of-interest
2个回答
5
投票

无法控制所绘制点的特定类型。 Apple可以在将来的Map Kit更新中添加/删除/更改其显示的特定类型。正如您提到的,唯一的操作方法是设置showsPointsOfInterest

您可以使用来自Foursquare或Facebook的第三方位置数据库来获取相似的兴趣点并将其绘制在地图上,但是不能保证结果与Apple否则会显示的结果相匹配。


0
投票

使用IOS 13,您可以选择过滤:这是一个在地图上不显示任何项目的示例

localMap.pointOfInterestFilter = .some(MKPointOfInterestFilter(including: []))

例如,您可以在地图上过滤机场...

localMap.pointOfInterestFilter = .some(MKPointOfInterestFilter(including: [MKPointOfInterestCategory.airport]))
© www.soinside.com 2019 - 2024. All rights reserved.