Tag: 谷歌地图 SDK IOS

使用Google Maps SDK在地图上绘制错误的多段线

我正在尝试使用Google地图SDK在我的地图上绘制路线。 这是我调用的URL,我parsing的JSON响应的坐标数组: id jsonResponse = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil]; int points_count = 0; points_count = [[[[[[jsonResponse objectForKey:@"routes"] objectAtIndex:0] objectForKey:@"legs"] objectAtIndex:0] objectForKey:@"steps"] count]; NSArray *steps = nil; if (points_count && [[[[jsonResponse objectForKey:@"routes"] objectAtIndex:0] objectForKey:@"legs"] count]) { steps = [[[[[jsonResponse objectForKey:@"routes"] objectAtIndex:0] objectForKey:@"legs"] objectAtIndex:0] objectForKey:@"steps"]; } NSMutableArray *coordinates = [[NSMutableArray alloc] initWithCapacity:points_count]; for (int i = 0; […]

如何覆盖/ swizzle在运行时的私人类的方法objective-c?

给我一点为什么我问这个问题的背景:基本上我想改变iOS的谷歌地图的myLocationButton的位置。 所以我首先获取像这样的实际button: @implementation GMSMapView (UIChanges) – (UIButton *)myLocationButton { UIButton *myLocationButton; for (myLocationButton in [settingView subviews]) { if ([myLocationButton isMemberOfClass:[UIButton class]]) break; } return myLocationButton; } 然后,我尝试改变它在屏幕上的位置使用NSLayoutConstraints(直接更改button的frame属性的值没有任何与谷歌地图SDK 1.8 +): UIButton *myLocationButton = [mapView_ myLocationButton]; [myLocationButton setTranslatesAutoresizingMaskIntoConstraints:NO]; [myLocationButton constraintRightEqualTo:[myLocationButton superview] constant:0]; [myLocationButton constraintTopEqualTo:[myLocationButton superview] constant:50]; 其中constraintRightEqualTo在类别中定义为: – (void)constraintRightEqualTo:(UIView *)toView constant:(CGFloat)constant { NSLayoutConstraint *cn = [NSLayoutConstraint constraintWithItem:self […]

Google Maps iOS rightCalloutAccessoryView更换?

只是想知道什么是在Google Maps SDK中更换rightCalloutAccessoryView (蓝色button)? 或者我需要自定义视图….. 编辑: 有比GMSMapViewDelegate的更好的select: – (void)mapView:(GMSMapView *)mapView didTapInfoWindowOfMarker:(id<GMSMarker>)marker; ? (对于用户来说,你可以点击信息窗口不明显) 编辑2 这个飞机search器 – 实时航class状态跟踪器似乎使用iOS SDK的默认标注: http : //bit.ly/PFinder 。 你是怎样做的?

Google Maps SDK for iOS不显示地图内容

我正在使用Google Maps SDK for iOS的当前版本1.1.2。 地图只显示Google徽标,当前位置和添加的标记。 但是没有任何地图内容: 我正确地注册了API密钥: BOOL result = [GMSServices provideAPIKey:@"<my key>"]; 结果是YES ,我确认bundleIdentifier与API控制台匹配。 我从故事板加载GMSMapView并将相机设置在我的-viewDidLoad : self.mapView.camera = [GMSCameraPosition cameraWithLatitude:0 longitude:0 zoom:2]; 这由GMSMapViewlogging: Failed to make complete framebuffer object 8cd6 Failed to make complete framebuffer object 8cd6 Google Maps SDK for iOS version: 1.1.2.2533 GMSZoomTableQuadTree lacks root zoom table for tile type (mapType: […]

使用Google Maps SDK for iOS优化自定义标记图片的性能

我最近在iOS应用程序中整合了Google Maps for iOS SDK。 这个应用程序旨在检索飞机的位置(包括飞机模型,经纬度,速度 – 飞机的基本价值),然后将其绘制在Google地图上。 现在,最近,API(我正在使用的)返回的飞机数量翻了一番,几乎翻了三倍。 我还没有问题,每次我尝试运行应用程序,它崩溃,给我以下错误: ((null)) was false: Reached the max number of texture atlases, can not allocate more. 我在SDK的Google Code上find了这个问题页面: https : //code.google.com/p/gmaps-api-issues/issues/detail?id=5756 – 在这里,我相信这个问题与我崩溃是下降到我正在使用自定义标记图像的数量。 每架飞机模型都有不同的图像,这些图像在渲染时被加载,并被分配给GMSMarker的UIImage。 现在,我遇到的问题是大量的结果,我得到这个崩溃。 同时,我也希望为每个标记提供单独的图像。 我的问题是,有没有一种方法,而不是分配一个特定的飞机的UIImage每个标记,我可以参考一次每个图像,以优化性能? 感谢您的帮助,请让我知道,如果我没有让自己清楚!

xCode 7错误:在Google Maps的框架模块中包含非模块化标题

我今天更新到xCode 7.1,并试图build立我的应用程序,但我得到这个错误: 我已经尝试去“目标”下的“生成设置”,并将“允许非模块化的包含在框架模块”设置为YES,但是这并没有解决这个问题。 更新:由于这是阻止我编译和阻碍我在开发方面的进展,我build议你从苹果( https://developer.apple.com/downloads/请确保login)下载旧版本的xCode。 您可以从链接下载7.0.1版本,至less继续开发。 这就是我所做的,我可以继续发展。 我知道这不是一个解决办法,但它是希望继续发展的人的解决方法。

GMSMapView myLocation不给实际的位置

我有一个GMSMapView正确加载,并在我的viewcontroller内工作 我无法做的是在我的位置周围设置GMSCameraPosition 这是我的代码: mapView_.myLocationEnabled = YES; CLLocation* myLoc = [mapView_ myLocation]; GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:myLoc.coordinate.latitude longitude:myLoc.coordinate.longitude zoom:4]; [mapView_ setCamera:camera]; GPS已启用,应用程序有所有需要的权限,但myLocation返回一个零CLLocation,因此cameraWithLatitude:longitude:zoom:获得0 0坐标,并显示非洲,而不是我的实际位置(这是非洲:))

GoogleMapsSDK:体系结构x86_64的未定义符号

我正在尝试安装Google maps SDK,并且在运行时遇到以下错误: Undefined symbols for architecture x86_64: "_CBAdvertisementDataManufacturerDataKey", referenced from: -[GMSx_PEBeaconScanner centralManager:didDiscoverPeripheral:advertisementData:RSSI:] in GoogleMaps(PEBeaconScanner.o) "_CBAdvertisementDataServiceDataKey", referenced from: -[GMSx_PEBeaconScanner centralManager:didDiscoverPeripheral:advertisementData:RSSI:] in GoogleMaps(PEBeaconScanner.o) "_CBCentralManagerScanOptionAllowDuplicatesKey", referenced from: -[GMSx_PEBeaconScanner scanIfAppropriate] in GoogleMaps(PEBeaconScanner.o) "_OBJC_CLASS_$_CBCentralManager", referenced from: objc-class-ref in GoogleMaps(PEBeaconScanner.o) "_OBJC_CLASS_$_CBUUID", referenced from: objc-class-ref in GoogleMaps(PEBeacon.o) objc-class-ref in GoogleMaps(PEBeaconScanner.o) "_vImageBoxConvolve_Planar8", referenced from: (anonymous namespace)::CreateBlurredImage(CGImage*, double, double) in GoogleMaps(GLWaterGroup.o) ld: symbol(s) […]

如何在GMSMapView中显示一个圆

我需要在GMSMapView上显示一个圆(与MKCircle一样)。 使用MKMapView和MKCircle时,这很容易,但不能在GMSMapView中使用MKCircle。 有任何想法吗? 更新: 这是目前(18.03.2013)的选项: 1.包含圆形图像的地面标记。 来自“现代汉英综合大词典”由多段(折线)组成的一个圆 编辑: 3. Google增加了一个GMSCircle(23.04.2013) GMSGroundOverlayOptions *overlayOptions = [GMSGroundOverlayOptions options]; overlayOptions.icon = [UIImage imageNamed:@"circle"]; overlayOptions.position = touchMapCoordinate; overlayOptions.bearing = 0; overlayOptions.zoomLevel = 14.3; [mapView addGroundOverlayWithOptions:overlayOptions]; 对于40×40像素的圆形图像,它看起来不错。 (半径大约100米) 小分段path解决scheme: GMSPolylineOptions *circle = [GMSPolylineOptions options]; CGPoint touchPoint = [mapView.projection pointForCoordinate:touchMapCoordinate]; GMSMutablePath *path = [GMSMutablePath path]; CGPoint circlePoint; for (int i = 0; […]

GoogleMaps SDK for iOS上有标记animation吗?

有没有可能在GMSMapView用animation移动/旋转GMSMarker ?