首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从数组列表中自动打开批注

从数组列表中自动打开批注
EN

Stack Overflow用户
提问于 2017-04-11 15:18:18
回答 1查看 110关注 0票数 0

我正在尝试自动打开我所有的注解引脚,这样用户就不需要实际触摸它们。我正在使用这个方法自动生成注解图钉。

代码语言:javascript
复制
filteredLocations.map {
        (location) in
        let annotation = MGLPointAnnotation()
        annotation.title = location.Neighborhood
        annotation.coordinate = CLLocationCoordinate2D(latitude:     location.latitude, longitude: location.longitude)
        mapView.addAnnotation(annotation)
        mapView.setCenter((mapView.userLocation?.coordinate)!,zoomLevel:11, animated:true)
        mapView.selectAnnotation(annotation, animated: true)

我尝试使用mapView.selectAnnotation(注释,动画: true)方法,但它似乎没有任何作用。

EN

回答 1

Stack Overflow用户

发布于 2017-04-11 15:25:50

您可以一次在iOS中为google标记显示一个InfoWindow。

代码语言:javascript
复制
mapView.selectedMarker = marker;

这将打开最后选择的标记的infoWindow。如果你想一次显示多个标记,那么你应该制作包含标记和信息窗口的自定义标记。

希望这对你有帮助。参考:How to show all Info window in iOS Google maps without tapping on Marker?

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

https://stackoverflow.com/questions/43339204

复制
相关文章

相似问题

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