ExternalMaps
外部地圖外掛開啟外部地圖以導航到特定的地理位置或地址。也可以選擇在 iOS 上使用導航選項啟動。
可在 NuGet 上找到:[ https://www.nuget.org/packages/Xam.Plugin.ExternalMaps/] [1 ]
XAML
<StackLayout Spacing="10" Padding="10">
<Button x:Name="navigateAddress" Text="Navigate to Address"/>
<Button x:Name="navigateLatLong" Text="Navigate to Lat|Long"/>
<Label Text=""/>
</StackLayout>
碼
namespace PluginDemo
{
public partial class ExternalMaps : ContentPage
{
public ExternalMaps()
{
InitializeComponent();
navigateLatLong.Clicked += (sender, args) =>
{
CrossExternalMaps.Current.NavigateTo("Space Needle", 47.6204, -122.3491);
};
navigateAddress.Clicked += (sender, args) =>
{
CrossExternalMaps.Current.NavigateTo("Xamarin", "394 pacific ave.", "San Francisco", "CA", "94111", "USA", "USA");
};
}
}
}