首页 > 解决方案 > iOS 谷歌地图标记,带有箭头的圆形气泡内的照片

问题描述

我需要谷歌地图中的自定义标记,我在 Android 中找到了一个链接如何制作带有圆形语音气泡内照片的谷歌地图标记?. 任何人都可以告诉我如何客观地做到这一点 - c。

标签: iosobjective-cgoogle-maps

解决方案


使用iconView属性GMSMarker将自定义视图呈现为标记。

代码:

UIImage *picture = [UIImage imageNamed:@"Your Picture"];
picture = [picture imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
UIImageView *pictureView = [[UIImageView alloc] initWithImage: picture];
pictureView.tintColor = [UIColor redColor];

CLLocationCoordinate2D position = CLLocationCoordinate2DMake(51.5, -0.127);
GMSMarker *marker = [GMSMarker markerWithPosition:position];
marker.iconView = pictureView;
marker.tracksViewChanges = YES;
marker.map = self.mapView;

更多信息,请访问https://developers.google.com/maps/documentation/ios-sdk/marker

在此处输入图像描述


推荐阅读