Google will display the color of the myLocation button after tracking the user's current location - ios

In the google map ios app, I find such a location button when it is not used for the current location Before tapping

After clicking on the myLocation button, it looks like this (blue color). Placement Button. Not a point. After getting current location

How can I do this in my ios app? Please help me Want this one blue tintnow this gray tint After and before finding your current location

+4
source share
1 answer

First you will get your current location using the code below -

CLLocationCoordinate2D myLocation = self.mapView.myLocation.coordinate;

You can then use GMSMarker to indicate your current location with an image or color.

 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;

Hopes for the code will help you.

0

Source: https://habr.com/ru/post/1589145/


All Articles