【发布时间】:2014-03-22 04:43:40
【问题描述】:
我想知道是否有一种方法可以更改所选标记的颜色或图像,然后在不再选择时将其更改回来。我看到使用 Apple Maps 的 Yelp 会更改所选标记的颜色/图像,然后在不再选择该标记后返回原始标记,并且想知道 Google Map iOS SDK 是否有类似的东西,或者是否有人遇到过这个问题并找到了解决方案。
我尝试过的:
我查看了谷歌关于标记的文档 (found here),发现他们有 marker.opacity 改变不透明度和 marker.icon = [GMSMarker markerImageWithColor:[UIColor blackColor]]; 改变标记颜色。
我尝试通过添加此行marker.icon = [GMSMarker markerImageWithColor: [UIColor differentColor]]; 或此行marker.icon = [UIImage imageNamed:@"differentColorImage"]; 手动更改-(UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker;,但是当您点击标记/信息窗口时,图像/颜色保持不变。
有人有什么想法吗?任何事情都有帮助。提前致谢!
【问题讨论】:
标签: ios iphone objective-c google-maps google-maps-markers