跟踪用户当前位置后,Google会映射myLocation按钮颜色 - ios

时间:2015-05-21 07:17:42

标签: ios objective-c google-maps

在谷歌地图ios应用程序中,当没有点击当前位置时,我会找到这样的位置按钮 Before tapping

点击myLocation按钮后,它就像这样(蓝色).Location按钮。不是点。 After getting current location

我如何在我的ios App中制作这个?请帮忙 现在想要blue tint这个gray tint 找到当前位置之前和之后

1 个答案:

答案 0 :(得分:0)

首先,使用以下代码获取当前位置 -

CLLocationCoordinate2D myLocation = self.mapView.myLocation.coordinate;

然后您可以使用GMSMarker将当前位置指向图像或颜色

 GMSMarker *marker = [[GMSMarker alloc] init];
    marker.position = CLLocationCoordinate2DMake(-33.86, 151.20);
    marker.title = @"Sydney";
    marker.snippet = @"Australia";
   // marker.icon = [GMSMarker markerImageWithColor:[UIColor redColor]];
    marker.icon = [UIImage imageNamed:@"point1.png"]; 
    marker.map = self.mapView;

希望上面的代码可以帮到你。