Google Map Loading issue in cordova ios

孤街浪徒 提交于 2020-01-21 22:03:56

问题


When I open Google Maps using google map URL for the first time(if google map is not running in background) direction will not show. If google map is running in background then direction will show properly. I am working on Cordova, in android, this issue is not there but in iOS, I am getting this issue. My code is: I used all these URL but it's not working in iOS if Google Maps is not running in the background.

var mapLocationUrl = "https://maps.google.com/maps?saddr=current location&daddr=" + lat + "," long;
var mapLocationUrl = "https://www.google.com/maps/dir/?api=1&destination=" + lat + "," + long + "&travelmode=driving";
var mapLocationUrl = "maps://maps.google.com/maps?daddr=" + lat + "," + long + "&ll=";
var mapLocationUrl = "comgooglemaps://?saddr=&daddr=" + lat + "," + long;
var mapLocationUrl = "https://maps.google.com/maps?origin=My Location" + "&daddr=" + lat + "," + long;
var mapLocationUrl = "https://maps.google.com/maps?daddr=" + lat + "," + lng;

window.open(encodeURI(mapLocationUrl), '_self', 'location=yes'); 
window`.open(encodeURI(mapLocationUrl), '_system', 'location=yes');

回答1:


It looks like this may be related to the following issue reported in Google's Issue Tracker:

https://issuetracker.google.com/issues/142856429

I recommend you star the issue to get updates on it and increase visibility.

Hope this helps you.



来源:https://stackoverflow.com/questions/58445322/google-map-loading-issue-in-cordova-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!