embedding google maps in UIWebView without asking for location permissions and showing the google panel

家住魔仙堡 提交于 2019-12-12 03:56:58

问题


I'm using google maps loaded in a UIWebView to display direction between 2 locations

here's the url I'm loading in the UIWebView

NSString *routeString = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f&output=embed",[myData.myLat doubleValue],[myData.myLng doubleValue],[view.annotation coordinate].latitude,[view.annotation coordinate].longitude];

when I remove the output=ember parameter the google panel is displayed but the UIWebView asks for permission to get user location which i already did in my app ,

when I add the output=embed the UIWebView do not ask for location permissions but the google panel is not showing.

How can I prevent the UIWebView from displaying the location permission and in the same time view the google panel ?

thnx


回答1:


answering my own questions . here are the url i used to load the map

NSString *routeString = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f&view=map&output=html",[myData.myLat doubleValue],[myData.myLng doubleValue],[view.annotation coordinate].latitude,[view.annotation coordinate].longitude];


来源:https://stackoverflow.com/questions/12980150/embedding-google-maps-in-uiwebview-without-asking-for-location-permissions-and-s

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