使用comgooglemaps的Google Map Direction

时间:2015-06-17 06:54:47

标签: ios google-maps directions

我正在使用谷歌地图方向 我正在尝试该代码,但它没有工作

 if ([[UIApplication sharedApplication] canOpenURL:
         [NSURL URLWithString:@"comgooglemaps://"]]) {
        [[UIApplication sharedApplication] openURL:
         [NSURL URLWithString:@"comgooglemaps://?center=40.765819,-73.975866&zoom=14&views=traffic"]];
    } else {
        NSLog(@"Can't use comgooglemaps://");
    }

始终有消息“无法使用comgooglemaps:// 是否有任何其他设置可以使用它。我已阅读谷歌文档,但没有这样的说明使用任何其他设置

1 个答案:

答案 0 :(得分:0)

  1. 要使此URL Scheme正常工作,您需要安装Google地图应用。

  2. 如果您想使用回调选项,则需要您的应用响应某些x-success。为此,please check this link。之后,在<ListBox Grid.Row="0" Name="ListBoxWindow" ItemsSource="{Binding}" ItemTemplate="{StaticResource Thumb}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" IsSynchronizedWithCurrentItem="True" Margin="0,0,0,20" Height="200" Width="300" ClipToBounds="True"> <ListBox.Template> <!--Does anyone know a better way to turn off horizontal scrolling in a ListBox?--> <ControlTemplate TargetType="ListBox" xmlns:s="clr-namespace:System;assembly=mscorlib"> <Border BorderBrush="{TemplateBinding Border.BorderBrush}" BorderThickness="{TemplateBinding Border.BorderThickness}" Name="Bd" Background="{TemplateBinding Panel.Background}" SnapsToDevicePixels="True" Padding="1,1,1,1"> <ScrollViewer VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Focusable="False" Padding="{TemplateBinding Control.Padding}"> <ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" ClipToBounds="{TemplateBinding ClipToBounds}" /> </ScrollViewer> </Border> 参数中传递自定义网址方案。