关于iphone中微信无法调用百度api的解决方案

http://api.map.baidu.com/direction?origin=latlng:22.550297,113.962555|name:我的位置&destination=22.553143,113.95336&mode=driving&region=''&output=html&src=yourCompanyName|yourAppName

这样的地址在安卓的微信中是能够调用百度的api,但是在iPhone的微信中不行。原因是参数需要encodeurl。

将参数endodeurl后,http://api.map.baidu.com/direction?origin=latlng%3a22.550297%2c113.962555%7cname%3a%e6%88%91%e7%9a%84%e4%bd%8d%e7%bd%ae&destination=22.553143%2c113.953485&mode=driving&region=''&output=html&src=yourCompanyName%7cyourAppName。就能够在iphone中调用了。

注:iphone4不行,可能是操作系统太低的原因。

原文地址:https://www.cnblogs.com/kouhh/p/3956545.html