Tag: gmsmapview

GoogleMaps(GMSView)不会在iOS中显示

我已经纳入了以下内容: 尝试通过Obj-C桥接头导入GoogleMaps/GoogleMaps.h以及GoogleMapsM4B/GoogleMaps.h文件 在我的AppDelegate.swift (didFinishLaunchingWithOptions)方法中手动inputiOS API密钥。 清理项目(命令+ shift + k) closures/重新启动Xcode 卸载/重新安装Xcode 和其他人所build议的几乎一样。 我花了两天的时间试图解决这个问题。 有谁知道这个问题的解决scheme? 控制台投诉是: > "2015-08-17 18:02:19.899 Project[608:10014] ClientParametersRequest > failed, 3 attempts remaining (0 vs 6). Error > Domain=com.google.HTTPStatus Code=400 "The operation couldn't be > completed. (com.google.HTTPStatus error 400.)" UserInfo=0x790bc050 > {data=<CFData 0x7925cb40 [0x22da9a8]>{length = 145, capacity = 256, > bytes = 0x3c48544d4c3e0a3c484541443e0a3c54 […]

按照用户所在的方向旋转GMSMarker

我有要求就像我目前的位置一个视图将显示。 它会旋转,如果设备是旋转或位置会改变。我研究了很多,但得到了所有的代码有一个固定的位置或angular度在某些位置,但我没有确定位置。 任何人都可以驾驶我正确的方向。 我也使用GMSMarker的旋转属性,但它不工作。 – (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading { if (newHeading.headingAccuracy < 0){ NSLog(@"heading accuracy < 0"); return; } // Convert Degree to Radian and move the needle float oldRad = (- manager.heading.trueHeading) * M_PI / 180.0f; float newRad = (- newHeading.trueHeading) * M_PI / 180.0f; // Compass animation CABasicAnimation *theAnimation; theAnimation = [CABasicAnimation […]

GMSMarker在GMSPolyline的各个angular落跳跃

我正在制作一个导航应用程序,并跟踪用户已经绘制的GMSPolyline上的当前运动。 当用户直行时,效果很好。 现在,假设在GMSPolyline上有左/右转或者掉头,现在根据我的GPS位置,我可以在20米左右进行一次更新,然后在30米之后转弯。 我的GPS没有收集到正好在转折点的点。 在这种情况下,我的GMSMarker从点x跳到y,如果我应用animation,那么它会沿着对angular线移动,不会沿着GMSPolyline弧线或曲线移动。 请build议我如何从GMSPolyline中收集那些缺less的点或者显示一些GMS标记的animation,以便用户可以看到他实际上正在打开折线。 我附上了一个样本图像。 红线可以理解为GMSPolylines,蓝点是我用CLLocation Manager收到的GPS坐标。

谷歌地图iOS sdk获取挖掘重叠坐标

我正在使用谷歌地图iOS sdk。 当用户点击叠加层时,我想要获取触摸点的坐标。 有这个委托方法: – (void)mapView:(GMSMapView *)mapView didTapAtCoordinate:(CLLocationCoordinate2D)coordinate 但是当你点击覆盖或标记时,它不会被调用。 我可以以编程方式调用它(但坐标参数是缺less的,这就是我想要的..)? 或从这里获得位置: – (void) mapView: (GMSMapView *) mapView didTapOverlay: (GMSOverlay *) overlay 任何build议的宝贵! 谢谢!

用箭头replaceGMSMapView中的蓝点 – Swift

我使用Google SDK作为应用程序iOS8(Swift)。 我想用智能手机的方向旋转的箭头来replaceGMSMapView中的蓝点(我的位置)。 我怎样才能做到这一点? 编辑: 我设法看到我的箭头,但我有三个问题: 1:箭头被切断,我没有find放大的区域 2:箭头的位置不完全在我的位置我通过删除“0,5”来解决这个问题: CGContextTranslateCTM(context, size.width, size.height) 3:箭头的方向与原来的对称我在“度”之前加“ – ”来解决这个问题: CGContextRotateCTM(context, CGFloat(DegreesToRadians(Double(-degrees)))) 如何解决这些问题?

如何在GMSMapView中获取animation折线路线,以便在地图移动时与地图一起移动?

我已经通过下面的代码创build了像CAShapeLayer这样的animation折线,我已经将CAShapeLayer作为子图层添加到GMSMapiew中,但是如果我移动地图,图层将不会移动。 在哪里添加图层,让它随着地图一起移动? func layer(from path: GMSPath) -> CAShapeLayer { let breizerPath = UIBezierPath() let firstCoordinate: CLLocationCoordinate2D = path.coordinate(at: 0) breizerPath.move(to: self.mapView.projection.point(for: firstCoordinate)) for i in 1 ..< Int((path.count())){ print(path.coordinate(at: UInt(i))) let coordinate: CLLocationCoordinate2D = path.coordinate(at: UInt(i)) breizerPath.addLine(to: self.mapView.projection.point(for: coordinate)) } let shapeLayer = CAShapeLayer() shapeLayer.path = breizerPath.reversing().cgPath shapeLayer.strokeColor = UIColor.green.cgColor shapeLayer.lineWidth = 4.0 shapeLayer.fillColor = […]

在iOS中的GMSMapView上绘制两个地方之间的路线

我正在开发一个iOS应用程序。 在那个应用程序中,我有2个字段从和。 我使用Google自动完成APIinput地址,同时我也能够获取2个位置的经度和纬度 ,并且能够在GMSMapView上显示标记。 现在我想在这两个地方之间画出路线。 当我们使用MKMapView时,我find了一个解决scheme。 但我无法findGMSMapView的解决scheme。 请帮我在GMSMapView绘制这两个点之间的路线。 如果可能的话请给我一些重要的链接。 谢谢。