ios调用Google地图
现在的ios版本一般只支持https协议,而引用谷歌地图API时只提供src="http://maps.google.cn/maps/api/js..",https协议无法使用,解决方法如下:
1.在ios壳中设置
在Info.plist中添加NSAppTransportSecurity类型Dictionary。
在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES
2.在项目中跳转至谷歌地图页面时不要使用相对路径如:"../",ios会默认使用https协议,会导致API无法引用,应使用全路径如:"http://...."。
浙公网安备 33010602011771号