Skip to content

Instantly share code, notes, and snippets.

@ziyang0621
Last active November 24, 2015 21:43
Show Gist options
  • Save ziyang0621/329f3ffec53f8a1b3e51 to your computer and use it in GitHub Desktop.
Save ziyang0621/329f3ffec53f8a1b3e51 to your computer and use it in GitHub Desktop.
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations {
[mapView_ clear];
CLLocation *location = (CLLocation*)locations.firstObject;
GMSMarker *pinview = [[GMSMarker alloc] init];
pinview.position = CLLocationCoordinate2DMake(location.coordinate.latitude, location.coordinate.longitude);
pinview.icon = [GMSMarker markerImageWithColor:[UIColor blueColor]];
pinview.title = @"title";
pinview.snippet = @"sub title";
pinview.map = mapView_;
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:location.coordinate.latitude
longitude:location.coordinate.longitude
zoom:6];
[mapView_ animateToCameraPosition:camera];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment