Tag: 谷歌地图 SDK IOS

mapView:didTapMarker没有select标记

我有一个带有很多标记的GMSMapView ,每个标记代表我的客户的一个存储,每当用户接近其中一个标记(到一个商店),他得到一个通知与商店的地址。 我希望当用户点击通知(通过通知打开应用程序)时,标记将显示在地图上(已经select)。 注意:标记是每个Store对象的属性, UILocalNotification存储Store对象的标识符,这就是我如何find正确的存储。 注2:我正在使用Google Maps iOS SDK 。 我试过这样做: -(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { NSString *storeIdentifier=[[notification userInfo] objectForKey:@"storeIdentifier"]; Store *notificationsStore=[self.monitorLocationVC storeForIdentifier:storeIdentifier]; [self.myVC mapView:self.myVC.mapView didTapMarker:notificationsStore.marker]; } 出于某种原因,用户打开应用程序时,标记未被选中。 我已经覆盖mapView: didTapMarker:在myVC.m像这样: -(BOOL)mapView:(GMSMapView *)mapView didTapMarker:(GMSMarker *)marker { return NO; }

在Google地图中移动相机

我正试图将相机在Google地图中移动到指定位置(经纬度)。 这是我的代码/函数,这个代码位于ViewController1(它包含mapView的视图): func select_structure(lat: String, lon: String){ let camera = GMSCameraPosition.cameraWithLatitude(Double(lat)!, longitude: Double(lon)!, zoom: 6.0) mapView = GMSMapView.mapWithFrame(CGRect.zero, camera: camera) mapView.myLocationEnabled = true mapView.mapType = kGMSTypeSatellite mapView.camera = camera view = mapView populate_structures2() let newcamera = GMSCameraPosition.cameraWithLatitude(Double(lat)!, longitude: Double(lon)!, zoom: 17.0) self.mapView.animateToCameraPosition(newcamera) print(mapView) } 当我在ViewController2中调用该代码时,第一次运行应用程序时,它不起作用。 当我使用这个函数时,什么都不会发生 但是我知道它正在被阅读。 而当我运行它的第二,第三等,它的作品! 只是一个简短的说明。 ViewController2是一个滑动菜单。 我从ViewController1调用这个函数: var ClassViewController = self.storyboard!.instantiateViewControllerWithIdentifier("ViewController") […]

使用Google Maps iOS SDK 1.4设置mapView.delegate

我刚刚从谷歌地图iOS SDK 1.3.1更新到1.4,现在我的应用程序崩溃,当我设置委托像mapView_.delegate = self 。 如果我删除这一行,我的委托方法不会被调用。 我如何在1.4版本中设置代理? 谢谢

如何findGoogle Maps Path的长度

我正在使用适用于iOS的Google Maps SDK,并使用GMSMutablePath对象创build了一个路由。 在API文档中 ,它说它有一个名为lengthOfKind的函数来计算path的长度,但是它需要一个GMSLengthKindtypes的对象。 (CLLocationDistance) lengthOfKind: (GMSLengthKind) kind Returns the length of the path, according to kind. See GMSLengthKind. 然而,在文档中没有提到GMSLengthKind ,我似乎无法find任何对input有意义的东西。 有谁知道inout应该是什么,或者如果有另一种方法来计算path的长度? 这是我咨询的链接

GMSMapView清除方法不是去除GMSPolygon iOS吗?

我使用下面的代码在谷歌地图中添加多边形 for(int i = 0; i < [[polygon valueForKey:@"coordinates"] count]; i++){ [self.path addCoordinate:CLLocationCoordinate2DMake([[[[polygon valueForKey:@"coordinates"] objectAtIndex:i] objectAtIndex:1] floatValue],[[[[polygon valueForKey:@"coordinates"] objectAtIndex:i] objectAtIndex:0] floatValue])]; } GMSPolygon *rectangle = [GMSPolygon polygonWithPath:self.path]; rectangle.fillColor = [UIColor colorWithRed:255.0/255.0 green:0.0/255.0 blue:0.0/255.0 alpha:0.4]; rectangle.map = self.mapView; rectangle.strokeColor=[UIColor redColor]; [self.restrictedLocations addObject:rectangle]; CLLocation *userLocation = [[mymanager sharedManager] userLocation]; [self.mapView bringSubviewToFront:self.locationMarkerView]; GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:userLocation.coordinate.latitude longitude:userLocation.coordinate.longitude […]

使用Google Maps SDK for iOS时,内存和CPU使用率非常高

我正在创build一个应用程序,我必须在地图上显示注册用户。 我必须显示他们的个人资料图片。 可能有很多,可能是1000,2000或3000。 问题是,通过添加每个图像,其内存使用增加,应用程序变慢。 例如,我正在使用这段代码: UIImageView * imgView = imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"like_r.png"]]; for(int i=0;i<1000;i++) { GMSMarker *marker = [[GMSMarker alloc] init]; marker.position = CLLocationCoordinate2DMake(31.4514885, 74.2642593); marker.iconView = imgView; marker.map=_mapView; } 有没有一种很好的方式来显示地图上的所有用户?

在Google地图中点击标记时显示信息窗口在实现mapView时执行iOS sdk:didTapMarker:实现了delegate方法

好吧,这是一个很长的标题。 当我使用谷歌地图iOS sdk时,我遇到了麻烦。 我想显示一个关于用户点击的标记的信息窗口。 根据文档,如果select代码和标题属性GMSMarker都select信息窗口将显示当用户点击该标记。 但是我也从GMSMapViewDelegate协议实现了mapView:didTapMarker:方法。 如果我注释掉方法信息窗口是可见的,否则信息窗口是不可见的。 那么,如何实现该方法时显示信息窗口?

无法使用iOS6.1 sdk为iOS版本1.7.0创buildGoogle Maps SDK

我刚更新到GMS版本1.7.0,无法使用基本SDK iOS6.1成功构build。 我可以用Base SDK iOS7.0成功构buildGMS版本1.7.0。 我也可以用Base SDK iOS6.0或7.0成功构build旧的GMS版本1.6.0。 以下是我的错误内容: 未定义的架构i386符号:“_glMapBufferRange”,引用来自:GoogleMaps(BufferObject.o)中的gmscore :: renderer :: BufferObject :: MapBuffer()ld:找不到架构i386的符号clang:error:linker命令失败退出代码1(使用-v来查看调用) 有人可以给我build议,谢谢你的帮助。

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 […]

谷歌地图工具包,绘制像谷歌地图ios散步折线

我想要使​​用谷歌地图ios sdk绘制折线的步行像谷歌地图应用程序在ios。 为了更清楚的理解我上传的图像是从谷歌地图应用程序(iOS)