Tag: 谷歌地图

如何从JSON输出数据解码路由点?

我是新的在ios领域,现在我试图实现基于MKMapView的iPhone应用程序。 从Google Map Web Web服务获取JSON输出格式的数据。 – (void)update { self.responseData=[NSMutableData data]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://maps.googleapis.com/maps/api/directions/json?origin=Ernakulam&destination=Kanyakumari&mode=driving&sensor=false"]]; [[NSURLConnection alloc] initWithRequest:request delegate:self]; } -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response{ [self.responseData setLength:0]; } -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{ [self.responseData appendData:data]; } -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error{ [connection release]; self.responseData =nil; } -(void)connectionDidFinishLoading:(NSURLConnection *)connection{ NSLog(@"connection established"); [connection release]; NSString *responseString=[[NSString alloc]initWithData:self.responseData encoding:NSUTF8StringEncoding]; self.responseData=nil; […]

iOS布局animation在GMSMapView拖动时忽略持续时间

你可以看到比较两个GIF下面的问题。 “缩小”和“拉伸”animation都基于约束操作, [self layoutIfNedeed]放置在-animateWithDuration块内。 正如你所看到的,当地图没有移动时,它就像预期的那样工作。 但是,当您开始拖动地图时,“缩小”animation会立即发生。 如果仔细观察,您可能会注意到cornerRadiusanimation仍然有效。 这告诉我,它可能与地图(scrollView里面?不知道如何谷歌地图工作)调用它自己的布局块,干扰我的animation。 或者这可能是由于cornerRadiusanimation是使用CABasicAnimation而不是UIViewanimation完成的。 animationInfoView不是mapView的子视图。 不知道当mapView调用内部布局方法时它是否会影响我的infoView的布局。 我试过所有的选项结合UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionOverrideInheritedDuration | UIViewAnimationOptionOverrideInheritedOptions UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionOverrideInheritedDuration | UIViewAnimationOptionOverrideInheritedOptions UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionOverrideInheritedDuration | UIViewAnimationOptionOverrideInheritedOptions只是为了看看是否有帮助。 它不是。 我想我可以直接克服这个操纵框架,而不是操纵约束,它会看起来一样的用户,但我觉得使用约束是如此的优雅。 我尽量避免操纵框架,并使用自动布局。 任何想法是什么导致这一点,以及如何使用自动布局animation克服这个问题? UPDATE 我试图直接animation框架 – 结果是一样的。 所以它与自动布局无关。 看起来像当前视图animation由于某种原因停止。 如果我用CABasicAnimationreplace我的UIViewanimation块,它就像一个魅力。 我被要求发布一些animation代码: – (void)shrink { if (!self.isStretched) return; self.stretched = NO; [self hideImageAndLabels]; [self.indicatorView startAnimating]; CABasicAnimation *animation = [CABasicAnimation […]

iOS GoogleMaps SDK错误:“:无法识别的select器发送”

我遵循开始使用谷歌地图的每一个步骤ios,我做了一切正常,但在每一个我尝试的例子,模拟器开始问我是否要打开GPS,然后,它会引发错误: 2013-03-07 16:05:09.135 Cicerone4all[352:14e03] Google Maps SDK for iOS version: 1.1.0.2080 2013-03-07 16:05:09.750 Cicerone4all[352:10d03] -[__NSCFDictionary objectForKeyedSubscript:]: unrecognized selector sent to instance 0xcac9b40 2013-03-07 16:05:09.755 Cicerone4all[352:10d03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary objectForKeyedSubscript:]: unrecognized selector sent to instance 0xcac9b40' *** First throw call stack: (0x24a5022 0x2636d0a 0x24a6cbd 0x240bed0 0x240bcb2 0xc7d21 0x14ea9e 0x14dc05 […]

在Swift项目中以缩放级别适合整个Google Map

我有一大堆坐标的谷歌地图 path.addCoordinate(CLLocationCoordinate2DMake(-37.813047, 144.959911)) path.addCoordinate(CLLocationCoordinate2DMake(-37.814895, 144.960759)) path.addCoordinate(CLLocationCoordinate2DMake(-37.814361, 144.963140)) path.addCoordinate(CLLocationCoordinate2DMake(-37.812386, 144.962239)) 我希望地图可以自动放大到基于点的最佳水平,但是我找不到与此有关的任何事情。 我有这个工作: var vancouver = CLLocationCoordinate2DMake(-37.813047, 144.959911) var calgary = CLLocationCoordinate2DMake(-37.814361, 144.963140) var bounds = GMSCoordinateBounds(coordinate: vancouver, coordinate: calgary) var camera = viewMap.cameraForBounds(bounds, insets:UIEdgeInsetsZero) viewMap.camera = camera 但是它只接受2个坐标,我可能有100个坐标 谢谢

我的位置button没有出现在视图中(Google maps SDK,ios)

这是我的mapViewController.m文件: @interface MapViewController() @property (strong, nonatomic) GMSMapView* mapView; @property (weak, nonatomic) IBOutlet GMSMapView *subView; @end @implementation MapViewController – (void) viewDidLoad{ // Create a GMSCameraPosition that tells the map to display the // coordinate -33.86,151.20 at zoom level 6. GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86 longitude:151.20 zoom:6]; _mapView = [GMSMapView mapWithFrame:self.view.bounds camera:camera]; _mapView.myLocationEnabled = YES; _mapView.settings.compassButton = […]

Google Maps API – > OpenGLES崩溃

日志是从Crashlytics粘贴。 碰撞经常发生,对许多用户来说,据我所知,它是独立于设备/ iOS版本。 我在代码中找不到任何错误,看起来像是纯库问题。 是Google Maps API的错误吗? 我能做些什么来修复它,或者我应该填写谷歌API页面上的一些错误报告..? 系统崩溃日志: Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x00000001 libGPUSupportMercury.dylib gpus_ReturnNotPermittedKillClient + 9 libGPUSupportMercury.dylib gldCreateContext GLEngine gliCreateContextWithShared OpenGLES -[EAGLContext initWithAPI:properties:] + 524 OpenGLES -[EAGLContext initWithAPI:sharedWithCompute:] + 142 !MYAPP! -[GMSIOSGLContext initWithAPI:] !MYAPP! gmscore::renderer::GMSIOSGLContextPool::GMSIOSGLContextPool() !MYAPP! ___ZN7gmscore8renderer13GLContextPool16GetGLContextPoolEv_block_invoke libdispatch.dylib _dispatch_client_callout + 22 libdispatch.dylib dispatch_once_f + 46 !MYAPP! gmscore::renderer::GLContextPool::GetGLContextPool() !MYAPP! gmscore::renderer::GLScopedContextFromPool::GLScopedContextFromPool() !MYAPP! -[GMSVectorMapSharedResourceCache init] […]

标记不在子视图IOS SWIFT中的谷歌地图中定位

你好,我试图把地图在子视图,但是当我把谷歌地图在子视图中,它不工作标记和GPS坐标不起作用 – 子视图 – 没有子视图 -SWIFT代码 import UIKit import GoogleMaps class HomeViewController: UIViewController, CLLocationManagerDelegate { @IBOutlet weak var mapView: GMSMapView! let locationManager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() locationManager.delegate = self locationManager.requestAlwaysAuthorization() let camera = GMSCameraPosition.cameraWithLatitude(15.4989, longitude: 73.8278, zoom: 6) let mapView = GMSMapView.mapWithFrame(CGRectZero, camera: camera) mapView.myLocationEnabled = true // self.view = mapView self.view.addSubview(mapView) […]

GoogleMaps iOS SDK 1.5将不会加载

所以我开始研究使用GoogleMaps iOS SDK。 我按照说明: 在控制台中启用Google Maps SDK for iOS 设置一个API密钥并添加了Bundle ID(我使用了示例Project Google Supplies) 更新了常用的“kAPIKey”作为我的项目的关键 我运行的应用程序,我得到以下 SDKDemos [7073:c07] ClientParametersRequest失败,剩余3次尝试(0 vs 5)。 错误域= com.google.HTTPStatus代码= 400“操作无法完成(com.google.HTTPStatus错误400.)”UserInfo = 0x8c4b0e0 {data = {length = 145,capacity = 256,bytes = 0x3c48544d4c3e0a3c484541443e0a3c54。 .. 3c2f48544d4c3e0a}} 2013-11-18 11:24:59.233 SDKDemos [7073:6403] Google Maps SDK for iOS版本:1.5.0.5445 … 2013-11-18 11:25:11.836 SDKDemos [7073:c07] Google Maps SDK for iOS无法连接或validationAPIKey:Error […]

IOS – ObjC Google Maps API密钥

我只是做了一切正确的提到这里,但Xcode仍然给出了这个错误: Google Maps SDK for iOS cannot connect or validate APIKey: Error Domain=com.google.HTTPStatus Code=400 "The operation couldn't be completed. (com.google.HTTPStatus error 400.)" UserInfo=0x8416b20 {data=<CFData 0x9187710 [0x27424d8]>{length = 145, capacity = 256, bytes = 0x3c48544d4c3e0a3c484541443e0a3c54 … 3c2f48544d4c3e0a}} 2013-09-01 15:04:04.902 MyApp[1357:12e03] Your key may be invalid for your bundle ID: MyBundleID 所以我search了一下,得到了这些: 第一个结果 , 第二个结果 ,从现在开始很枯燥。 有没有办法让这个邮件的事情更快,或者我做错了什么仍然?

在谷歌地图上突出显示iOS和iOS的国家

我正试图在地图上突出显示国家。 对于iOS我发现几个演示 demo1的 DEMO2 但我正在寻找适用于ios和android的api。 我查找谷歌地图API版本1.8.1。 实现这个只是通过在地图上绘制多边形为那些特定的国家? 有没有其他的好办法来达到这个目的呢?