LocationAPI
Objective-C class for finding coordinates of a location using Google Maps
Install / Use
/learn @insidegui/LocationAPIREADME
LocationAPI
A simple class to get a location's coordinate using Google Maps API
Examples
Find the coordinate for Cupertino
[[LocationAPI sharedLocationAPI] coordinateForLocationNamed:@"Cupertino" callback:^(CLLocationCoordinate2D coordinate, NSError *error) {
if (error) {
[[[UIAlertView alloc] initWithTitle:@"Error" message:error.localizedDescription delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil] show];
return;
}
NSLog(@"Coordinates: %f,%f", coordinate.latitude, coordinate.longitude);
}];
Zoom to a specific location in a MKMapView
[[LocationAPI sharedLocationAPI] coordinateForLocationNamed:self.locationName callback:^(CLLocationCoordinate2D coordinate, NSError *error) {
if (error) {
[[[UIAlertView alloc] initWithTitle:@"Error" message:error.localizedDescription delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil] show];
return;
}
MKCoordinateRegion zoomRegion = MKCoordinateRegionMakeWithDistance(coordinate, 2000, 2000);
// self.mapView is a MKMapView in this ViewController's view
[self.mapView setRegion:zoomRegion animated:YES];
}];
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
