我正在使用Google的' reverseGeocodeCoordinate'来获取基于纬度和经度的地址.
我在实现中遇到以下错误
对成员'joinWithSeparator'的模糊引用
以下是我的实施:
let aGMSGeocoder: GMSGeocoder = GMSGeocoder()
aGMSGeocoder.reverseGeocodeCoordinate(CLLocationCoordinate2DMake(17.45134626, 78.39304448)) {
(let gmsReverseGeocodeResponse: GMSReverseGeocodeResponse!, let error: NSError!) -> Void in
let gmsAddress: GMSAddress = gmsReverseGeocodeResponse.firstResult()
print("lines=\(gmsAddress.lines)")
let addressString = gmsAddress.lines.joinWithSeparator("")
print("addressString=\(addressString)")
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试addressString使用数组' gmsAddress.lines'中的元素创建一个,但最终会出现错误消息.
实施了一些示例代码片段来测试' joinWithSeparator'
let sampleArray = ["1", "2", "3", "4", "5"]
let joinedString = sampleArray.joinWithSeparator("")
print("joinedString=\(joinedString)")
Run Code Online (Sandbox Code Playgroud)
它成功了.
我观察到的是' sampleArray'是一个类型的元素数组String,但是' gmsAddress.lines'是' AnyObject' 类型的元素数组,在' GMSAddress'库中找到:
/** An array of NSString containing formatted lines of the address. …Run Code Online (Sandbox Code Playgroud) 我正在尝试安装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) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud) 我已经通过以下代码创建了像CAShapeLayer的动画折线,我已经将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 = UIColor.clear.cgColor
shapeLayer.lineJoin = kCALineJoinRound
shapeLayer.lineCap = kCALineCapRound
shapeLayer.cornerRadius = 5
return shapeLayer
}
func animatePath(_ layer: CAShapeLayer) {
let pathAnimation = CABasicAnimation(keyPath: "strokeEnd")
pathAnimation.duration = 6 …Run Code Online (Sandbox Code Playgroud) 简单的问题
我正在开发适用于iOS的App,我在其中嵌入了适用于原生iOS的新Google Map.一切正常,除了一个问题,我无法在这里或谷歌找到本地IOS/Objective-C的propper解决方案(如果有一个请告诉我,抱歉让你讨厌)
我想要的是:我希望用户点击打开信息窗口的标记.如果他点击或点击信息窗口,它应该打开一个新的UIView与更多的信息.
我怎样才能做到这一点?
谢谢你的建议
objective-c onclick google-maps-markers ios google-maps-sdk-ios
我知道关于这个主题已经有一些关于SO的问题,但是很少有人接受了答案,我认为我没有找到与我相同的问题.
我正在构建一个Swift pod,在我的代码中,我依赖于Google Maps iOS SDK,它被捆绑为一个.framework文件.该项目在Xcode中构建正常,但是我很难将lib发布到Cocoapods.
我设法有一个Podspec几乎使用该pod lib lint命令验证的文件.但是,现在我已将Google-Maps-iOS-SDKpod 添加为Podspec文件中的依赖项,但它失败并显示以下消息:
$ pod lib lint
[!]'Pods'目标具有包含静态二进制文件的传递依赖:(/private/var/folders/n2/qyjfpk6n7zz_mngtwswlmsy00000gn/T/CocoaPods/Lint/Pods/Google-Maps-iOS-SDK/GoogleMaps.framework)
$
这是预期的吗?为什么我不能在我自己的基于Swift的pod中添加Google Maps iOS SDK作为pod引用?
这是Podspec:
Pod::Spec.new do |s|
s.name = '(name)'
s.version = '1.0.0'
s.summary = '(summary)'
s.platforms = { :ios => '8.0', :osx => '10.10' }
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.10'
s.license = { :type => 'BSD', :file => 'LICENSE' }
s.source_files = 'Sources/*.{h,swift}', '*.framework'
s.source = { :git => …Run Code Online (Sandbox Code Playgroud) 我刚刚下载了Xcode 7 beta 4并且我正在尝试构建我的Swift 2.0应用程序,但是我收到以下错误,我无法找到解决方案:
ld:警告:-weak_framework与-bitcode_bundle(Xcode设置ENABLE_BITCODE = YES)一起使用时被视为-framework.根据标题ld中的可用性标记,仍可能发生弱链接:'path/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(GMSBillingPointRecorder.o)'不包含bitcode.您必须在启用bitcode(Xcode设置ENABLE_BITCODE)的情况下重建它,从供应商处获取更新的库,或禁用此目标的bitcode.for architecture arm64 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
有谁知道如何解决这个问题?
我最近在iOS应用中整合了Google Maps for iOS SDK.此应用程序旨在检索飞机的位置(包括飞机模型,纬度/经度,速度 - 飞机的基本值),然后在谷歌地图上绘制它们.
现在,最近,API(我正在使用的)返回的飞机数量增加了一倍,几乎增加了两倍.之前我没有遇到任何问题我每次尝试运行应用程序时都会崩溃,并给出以下错误:
((null)) was false: Reached the max number of texture atlases, can not allocate more.
Run Code Online (Sandbox Code Playgroud)
我在SDK的Google代码上找到了此问题页面:https://code.google.com/p/gmaps-api-issues/issues/detail?id = 5756 - 在这里,我被认为是与我的问题崩溃是我正在使用的自定义标记图像的数量.每个飞机模型都有不同的图像,这些图像在渲染时加载,UIImage分配给GMSMarker.
现在,我遇到的问题是有大量的结果,我得到了这个崩溃.同时,我还希望为每个标记提供单独的图像.
我的问题是,有没有一种方法,而不是为每个标记分配特定飞机的UIImage,我可以一次参考每个图像来优化性能吗?
感谢您的帮助,如果我没有说清楚,请告诉我!
我知道谷歌地图的java版本很容易,但我无法弄清楚如何在SDK的目标C版本中关闭信息窗口.
我正在使用这种方法:
-(void) mapView:(GMSMapView *)mapView
didTapInfoWindowOfMarker:(id<GMSMarker>)marker {
sharedGlobal.shouldShowPlayer = YES;
/* adds the path to the map by decoding google's encoded string */
[self addPath: sharedGlobal.encodedPathString];
}
Run Code Online (Sandbox Code Playgroud)
并希望添加一行来关闭与标记相关的信息窗口.
我们有一个谷歌API密钥,过去几个月一直在工作,但突然昨天它停止工作是错误.
2013-09-20 23:01:36.483 SampleApp[907:a0b] 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=0x18828d90 {data=<CFData 0x14d04c30 [0x6174ec8]>{length = 145, capacity = 256, bytes = 0x3c48544d4c3e0a3c484541443e0a3c54 ... 3c2f48544d4c3e0a}}
2013-09-20 23:01:36.484 SampleApp[907:a0b] Your key may be invalid for your bundle ID: com.company.SampleApp
我们无法找到拥有API密钥的帐户.我们是否有办法联系Google Maps API小组请求帮助识别帐户并帮助解决问题?
google-maps google-api google-maps-api-3 google-maps-sdk-ios
ios ×7
google-maps ×4
objective-c ×3
swift ×3
cocoapods ×1
gmsmapview ×1
google-api ×1
infowindow ×1
ios9 ×1
lint ×1
marker ×1
nsarray ×1
onclick ×1
xcode ×1
xcode7-beta4 ×1