我正在尝试自动打开我所有的注解引脚,这样用户就不需要实际触摸它们。我正在使用这个方法自动生成注解图钉。
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)方法,但它似乎没有任何作用。
发布于 2017-04-11 15:25:50
您可以一次在iOS中为google标记显示一个InfoWindow。
mapView.selectedMarker = marker;这将打开最后选择的标记的infoWindow。如果你想一次显示多个标记,那么你应该制作包含标记和信息窗口的自定义标记。
希望这对你有帮助。参考:How to show all Info window in iOS Google maps without tapping on Marker?
https://stackoverflow.com/questions/43339204
复制相似问题