【问题标题】:Draw route on google application ios sdk?在谷歌应用程序 ios sdk 上绘制路线?
【发布时间】:2014-03-03 07:37:46
【问题描述】:

我想绘制从当前位置到目的地位置的路线。

我正在使用以下代码。

if ([[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"comgooglemaps://"]]) {
        NSString *urlString = [NSString stringWithFormat:@"comgooglemaps://?saddr=%f,%f&daddr=%@,%@&directionsmode=driving",
                               appDelegate.myLocation.coordinate.latitude,
                               appDelegate.myLocation.coordinate.longitude,
                               self.objPlace.strLatitude,
                               self.objPlace.strLongitude];
        [[UIApplication sharedApplication] openURL: [NSURL URLWithString: urlString]];
    }

结果图片 ---------------------------------- 预期图片

comgooglemaps://?saddr=23.033646,72.559139&daddr=23.033018,72.557025&directionsmode=driving

注意:我要求不在应用程序内的原生谷歌应用程序

但它没有显示路线?

【问题讨论】:

    标签: ios objective-c google-maps


    【解决方案1】:

    我确实在其他主题中回答了这个问题。请在链接GoogleMap API Gives Wrong Coordinates for Direction between two Points查看此主题

    【讨论】:

    • 我不是要求在应用程序中进行路由。我想在构建谷歌地图应用程序中绘制路线
    • 是的,但它在 safari 中打开
    • 当您的设备安装 googlemap 应用程序时,请使用此链接“maps.google.com/maps?”将打开地图应用程序,但如果您使用的设备没有地图应用程序或模拟器,它将在 safari 中打开
    猜你喜欢
    • 2013-06-23
    • 2011-06-07
    • 2021-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多