diff --git a/DeviceTests/DeviceTests.Shared/DeviceTests.Shared.projitems b/DeviceTests/DeviceTests.Shared/DeviceTests.Shared.projitems
index 48dc3409f..0da11cb8d 100644
--- a/DeviceTests/DeviceTests.Shared/DeviceTests.Shared.projitems
+++ b/DeviceTests/DeviceTests.Shared/DeviceTests.Shared.projitems
@@ -24,6 +24,7 @@
+
diff --git a/DeviceTests/DeviceTests.Shared/Maps_Tests.cs b/DeviceTests/DeviceTests.Shared/Maps_Tests.cs
new file mode 100644
index 000000000..cf1e0a9c8
--- /dev/null
+++ b/DeviceTests/DeviceTests.Shared/Maps_Tests.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Threading.Tasks;
+using Xamarin.Essentials;
+using Xunit;
+
+namespace DeviceTests
+{
+ public class Maps_Tests
+ {
+ const double testLatitude = 47.645160;
+ const double testLongitude = -122.1306032;
+ const string mapName = "Microsoft Building 25";
+
+ [Fact]
+ [Trait(Traits.InteractionType, Traits.InteractionTypes.Human)]
+ public async Task LaunchMap_CoordinatesDisplayCorrectPlace()
+ {
+ await Maps.OpenAsync(testLatitude, testLongitude, new MapsLaunchOptions { Name = mapName });
+ }
+
+ [Fact]
+ [Trait(Traits.InteractionType, Traits.InteractionTypes.Human)]
+ public async Task LaunchMap_PlacemarkDisplayCorrectPlace()
+ {
+ var placemark = new Placemark
+ {
+ CountryName = "United States",
+ AdminArea = "WA",
+ Thoroughfare = "Microsoft Building 25",
+ Locality = "Redmond"
+ };
+ await Maps.OpenAsync(placemark, new MapsLaunchOptions { Name = mapName });
+ }
+
+ [Fact]
+ public async Task LaunchMap_NullLocation()
+ {
+ Location location = null;
+ await Assert.ThrowsAsync(() => Maps.OpenAsync(location));
+ }
+
+ [Fact]
+ public async Task LaunchMap_NullOptionsLocation()
+ {
+ var location = new Location(testLatitude, testLongitude);
+ await Assert.ThrowsAsync(() => Maps.OpenAsync(location, null));
+ }
+
+ [Fact]
+ public async Task LaunchMap_NullPlacemark()
+ {
+ Placemark location = null;
+ await Assert.ThrowsAsync(() => Maps.OpenAsync(location));
+ }
+
+ [Fact]
+ public async Task LaunchMap_NullOptionsPlacemark()
+ {
+ var placemark = new Placemark
+ {
+ CountryName = "United States",
+ AdminArea = "WA",
+ Thoroughfare = "Microsoft Building 25",
+ Locality = "Redmond"
+ };
+ await Assert.ThrowsAsync(() => Maps.OpenAsync(placemark, null));
+ }
+ }
+}
diff --git a/Samples/Samples/View/MapsPage.xaml b/Samples/Samples/View/MapsPage.xaml
new file mode 100644
index 000000000..9c7aae675
--- /dev/null
+++ b/Samples/Samples/View/MapsPage.xaml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Samples/View/MapsPage.xaml.cs b/Samples/Samples/View/MapsPage.xaml.cs
new file mode 100644
index 000000000..3da0b9cd6
--- /dev/null
+++ b/Samples/Samples/View/MapsPage.xaml.cs
@@ -0,0 +1,13 @@
+using Xamarin.Forms.Xaml;
+
+namespace Samples.View
+{
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class MapsPage : BasePage
+ {
+ public MapsPage()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Samples/Samples/ViewModel/HomeViewModel.cs b/Samples/Samples/ViewModel/HomeViewModel.cs
index 52101fa22..6e7661fbb 100644
--- a/Samples/Samples/ViewModel/HomeViewModel.cs
+++ b/Samples/Samples/ViewModel/HomeViewModel.cs
@@ -126,6 +126,12 @@ public HomeViewModel()
typeof(MagnetometerPage),
"Detect device's orientation relative to Earth's magnetic field.",
new[] { "compass", "magnetometer", "sensors", "hardware", "device" }),
+ new SampleItem(
+ "📍",
+ "Launch Maps",
+ typeof(MapsPage),
+ "Easily launch maps with coordinates.",
+ new[] { "geocoding", "geolocation", "position", "address", "mapping", "maps", "route", "navigation" }),
new SampleItem(
"📏",
"Orientation Sensor",
diff --git a/Samples/Samples/ViewModel/MapsViewModel.cs b/Samples/Samples/ViewModel/MapsViewModel.cs
new file mode 100644
index 000000000..be81a9cf4
--- /dev/null
+++ b/Samples/Samples/ViewModel/MapsViewModel.cs
@@ -0,0 +1,110 @@
+using System.Collections.Generic;
+using System.Windows.Input;
+using Xamarin.Essentials;
+using Xamarin.Forms;
+
+namespace Samples.ViewModel
+{
+ public class MapsViewModel : BaseViewModel
+ {
+ string name = "Microsoft Building 25";
+
+ public string Name
+ {
+ get => name;
+ set => SetProperty(ref name, value);
+ }
+
+ string longitude = "-122.130603";
+
+ public string Longitude
+ {
+ get => longitude;
+ set => SetProperty(ref longitude, value);
+ }
+
+ string latitude = "47.645160";
+
+ public string Latitude
+ {
+ get => latitude;
+ set => SetProperty(ref latitude, value);
+ }
+
+ string locality = "Redmond";
+
+ public string Locality
+ {
+ get => locality;
+ set => SetProperty(ref locality, value);
+ }
+
+ string adminArea = "WA";
+
+ public string AdminArea
+ {
+ get => adminArea;
+ set => SetProperty(ref adminArea, value);
+ }
+
+ string thoroughfare = "Microsoft Building 25";
+
+ public string Thoroughfare
+ {
+ get => thoroughfare;
+ set => SetProperty(ref thoroughfare, value);
+ }
+
+ string country = "United States";
+
+ public string Country
+ {
+ get => country;
+ set => SetProperty(ref country, value);
+ }
+
+ public List DirectionModes { get; } =
+ new List
+ {
+ "Default",
+ "Driving",
+ "Transit",
+ "Walking"
+ };
+
+ int directionMode;
+
+ public int DirectionMode
+ {
+ get => directionMode;
+ set => SetProperty(ref directionMode, value);
+ }
+
+ public ICommand MapsCommand { get; }
+
+ public ICommand LaunchPlacemarkCommand { get; }
+
+ public MapsViewModel()
+ {
+ MapsCommand = new Command(OpenLocation);
+ LaunchPlacemarkCommand = new Command(OpenPlacemark);
+ }
+
+ async void OpenLocation()
+ {
+ await Maps.OpenAsync(double.Parse(Latitude), double.Parse(Longitude), new MapsLaunchOptions { Name = Name, MapDirectionsMode = (MapDirectionsMode)DirectionMode });
+ }
+
+ async void OpenPlacemark()
+ {
+ var placemark = new Placemark
+ {
+ Locality = Locality,
+ AdminArea = AdminArea,
+ CountryName = Country,
+ Thoroughfare = Thoroughfare
+ };
+ await Maps.OpenAsync(placemark, new MapsLaunchOptions() { Name = Name, MapDirectionsMode = (MapDirectionsMode)DirectionMode });
+ }
+ }
+}
diff --git a/Tests/Maps_Tests.cs b/Tests/Maps_Tests.cs
new file mode 100644
index 000000000..e5556b689
--- /dev/null
+++ b/Tests/Maps_Tests.cs
@@ -0,0 +1,70 @@
+using System;
+using System.Threading.Tasks;
+using Xamarin.Essentials;
+using Xunit;
+
+namespace Tests
+{
+ public class Maps_Tests
+ {
+ const double testLatitude = 47.645160;
+ const double testLongitude = -122.1306032;
+ const string mapName = "Microsoft Building 25";
+
+ [Fact]
+ public async Task Open_Map_LatLong_NetStandard() =>
+ await Assert.ThrowsAsync(
+ () => Maps.OpenAsync(
+ testLatitude,
+ testLongitude,
+ new MapsLaunchOptions { Name = mapName }));
+
+ [Fact]
+ public async Task Open_Map_Location_NetStandard() =>
+ await Assert.ThrowsAsync(
+ () => Maps.OpenAsync(
+ new Location(testLatitude, testLongitude),
+ new MapsLaunchOptions { Name = mapName }));
+
+ [Fact]
+ public async Task Open_Map_Placemark_NetStandard() =>
+ await Assert.ThrowsAsync(
+ () => Maps.OpenAsync(
+ new Placemark(),
+ new MapsLaunchOptions { Name = mapName }));
+
+ [Fact]
+ public async Task LaunchMap_NullLocation()
+ {
+ Location location = null;
+ await Assert.ThrowsAsync(() => Maps.OpenAsync(location));
+ }
+
+ [Fact]
+ public async Task LaunchMap_NullOptionsLocation()
+ {
+ var location = new Location(testLatitude, testLongitude);
+ await Assert.ThrowsAsync(() => Maps.OpenAsync(location, null));
+ }
+
+ [Fact]
+ public async Task LaunchMap_NullPlacemark()
+ {
+ Placemark location = null;
+ await Assert.ThrowsAsync(() => Maps.OpenAsync(location));
+ }
+
+ [Fact]
+ public async Task LaunchMap_NullOptionsPlacemark()
+ {
+ var placemark = new Placemark
+ {
+ CountryName = "United States",
+ AdminArea = "WA",
+ Thoroughfare = "Microsoft Building 25",
+ Locality = "Redmond"
+ };
+ await Assert.ThrowsAsync(() => Maps.OpenAsync(placemark, null));
+ }
+ }
+}
diff --git a/Xamarin.Essentials/Maps/MapDirectionsMode.shared.cs b/Xamarin.Essentials/Maps/MapDirectionsMode.shared.cs
new file mode 100644
index 000000000..1a458863f
--- /dev/null
+++ b/Xamarin.Essentials/Maps/MapDirectionsMode.shared.cs
@@ -0,0 +1,10 @@
+namespace Xamarin.Essentials
+{
+ public enum MapDirectionsMode
+ {
+ Default,
+ Driving,
+ Transit,
+ Walking
+ }
+}
diff --git a/Xamarin.Essentials/Maps/MapLaunchOptions.shared.cs b/Xamarin.Essentials/Maps/MapLaunchOptions.shared.cs
new file mode 100644
index 000000000..25856e945
--- /dev/null
+++ b/Xamarin.Essentials/Maps/MapLaunchOptions.shared.cs
@@ -0,0 +1,9 @@
+namespace Xamarin.Essentials
+{
+ public class MapsLaunchOptions
+ {
+ public MapDirectionsMode MapDirectionsMode { get; set; } = MapDirectionsMode.Default;
+
+ public string Name { get; set; } = string.Empty;
+ }
+}
diff --git a/Xamarin.Essentials/Maps/Maps.android.cs b/Xamarin.Essentials/Maps/Maps.android.cs
new file mode 100644
index 000000000..a144cf7e8
--- /dev/null
+++ b/Xamarin.Essentials/Maps/Maps.android.cs
@@ -0,0 +1,38 @@
+using System.Globalization;
+using System.Threading.Tasks;
+using Android.Content;
+using AndroidUri = Android.Net.Uri;
+
+namespace Xamarin.Essentials
+{
+ public static partial class Maps
+ {
+ internal static Task PlatformOpenMapsAsync(double latitude, double longitude, MapsLaunchOptions options)
+ {
+ var uri = string.Empty;
+ uri = $"geo:{latitude.ToString(CultureInfo.InvariantCulture)},{longitude.ToString(CultureInfo.InvariantCulture)}?q={latitude.ToString(CultureInfo.InvariantCulture)},{longitude.ToString(CultureInfo.InvariantCulture)}";
+ if (!string.IsNullOrWhiteSpace(options.Name))
+ uri += $"({options.Name})";
+ StartIntent(uri);
+ return Task.CompletedTask;
+ }
+
+ internal static Task PlatformOpenMapsAsync(Placemark placemark, MapsLaunchOptions options)
+ {
+ placemark = placemark.Escape();
+ var uri = $"geo:0,0?q={placemark.Thoroughfare} {placemark.Locality} {placemark.AdminArea} {placemark.CountryName}";
+ if (!string.IsNullOrWhiteSpace(options.Name))
+ uri += $"({options.Name})";
+ StartIntent(uri);
+ return Task.CompletedTask;
+ }
+
+ static void StartIntent(string uri)
+ {
+ var intent = new Intent(Intent.ActionView, AndroidUri.Parse(uri));
+ intent.SetFlags(ActivityFlags.ClearTop);
+ intent.SetFlags(ActivityFlags.NewTask);
+ Platform.AppContext.StartActivity(intent);
+ }
+ }
+}
diff --git a/Xamarin.Essentials/Maps/Maps.ios.cs b/Xamarin.Essentials/Maps/Maps.ios.cs
new file mode 100644
index 000000000..8d607f3cd
--- /dev/null
+++ b/Xamarin.Essentials/Maps/Maps.ios.cs
@@ -0,0 +1,85 @@
+using System;
+using System.Diagnostics;
+using System.Threading.Tasks;
+using CoreLocation;
+using Foundation;
+using MapKit;
+
+namespace Xamarin.Essentials
+{
+ public static partial class Maps
+ {
+ internal static Task PlatformOpenMapsAsync(double latitude, double longitude, MapsLaunchOptions options)
+ {
+ if (string.IsNullOrWhiteSpace(options.Name))
+ options.Name = string.Empty;
+
+ NSDictionary dictionary = null;
+ var placemark = new MKPlacemark(new CLLocationCoordinate2D(latitude, longitude), dictionary);
+ return OpenPlacemark(placemark, options);
+ }
+
+ internal static async Task PlatformOpenMapsAsync(Placemark placemark, MapsLaunchOptions options)
+ {
+ var address = new MKPlacemarkAddress
+ {
+ CountryCode = placemark.CountryCode,
+ Country = placemark.CountryName,
+ State = placemark.AdminArea,
+ Street = placemark.Thoroughfare,
+ City = placemark.Locality
+ };
+
+ var coder = new CLGeocoder();
+ CLPlacemark[] placemarks = null;
+ try
+ {
+ placemarks = await coder.GeocodeAddressAsync(address.Dictionary);
+ }
+ catch
+ {
+ Debug.WriteLine("Unable to get geocode address from address");
+ return;
+ }
+
+ if ((placemarks?.Length ?? 0) == 0)
+ {
+ Debug.WriteLine("No locations exist, please check address.");
+ }
+
+ await OpenPlacemark(new MKPlacemark(placemarks[0].Location.Coordinate, address), options);
+ }
+
+ static Task OpenPlacemark(MKPlacemark placemark, MapsLaunchOptions options)
+ {
+ var mapItem = new MKMapItem(placemark)
+ {
+ Name = options.Name ?? string.Empty
+ };
+
+ var mode = MKDirectionsMode.Default;
+
+ switch (options.MapDirectionsMode)
+ {
+ case MapDirectionsMode.Driving:
+ mode = MKDirectionsMode.Driving;
+ break;
+ case MapDirectionsMode.Transit:
+ mode = MKDirectionsMode.Transit;
+ break;
+ case MapDirectionsMode.Walking:
+ mode = MKDirectionsMode.Walking;
+ break;
+ }
+
+ var launchOptions = new MKLaunchOptions
+ {
+ DirectionsMode = mode
+ };
+
+ var mapItems = new[] { mapItem };
+ MKMapItem.OpenMaps(mapItems, launchOptions);
+ return Task.CompletedTask;
+ }
+ }
+}
diff --git a/Xamarin.Essentials/Maps/Maps.netstandard.cs b/Xamarin.Essentials/Maps/Maps.netstandard.cs
new file mode 100644
index 000000000..7c315680b
--- /dev/null
+++ b/Xamarin.Essentials/Maps/Maps.netstandard.cs
@@ -0,0 +1,13 @@
+using System.Threading.Tasks;
+
+namespace Xamarin.Essentials
+{
+ public static partial class Maps
+ {
+ internal static Task PlatformOpenMapsAsync(double latitude, double longitude, MapsLaunchOptions options)
+ => throw new NotImplementedInReferenceAssemblyException();
+
+ internal static Task PlatformOpenMapsAsync(Placemark placemark, MapsLaunchOptions options)
+ => throw new NotImplementedInReferenceAssemblyException();
+ }
+}
diff --git a/Xamarin.Essentials/Maps/Maps.shared.cs b/Xamarin.Essentials/Maps/Maps.shared.cs
new file mode 100644
index 000000000..4971c2f84
--- /dev/null
+++ b/Xamarin.Essentials/Maps/Maps.shared.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Threading.Tasks;
+
+namespace Xamarin.Essentials
+{
+ public static partial class Maps
+ {
+ public static Task OpenAsync(Location location) =>
+ OpenAsync(location, new MapsLaunchOptions());
+
+ public static Task OpenAsync(Location location, MapsLaunchOptions options)
+ {
+ if (location == null)
+ throw new ArgumentNullException(nameof(location));
+
+ if (options == null)
+ throw new ArgumentNullException(nameof(options));
+
+ return PlatformOpenMapsAsync(location.Latitude, location.Longitude, options);
+ }
+
+ public static Task OpenAsync(double latitude, double longitude) =>
+ OpenAsync(latitude, longitude, new MapsLaunchOptions());
+
+ public static Task OpenAsync(double latitude, double longitude, MapsLaunchOptions options)
+ {
+ if (options == null)
+ throw new ArgumentNullException(nameof(options));
+
+ return PlatformOpenMapsAsync(latitude, longitude, options);
+ }
+
+ public static Task OpenAsync(Placemark placemark) =>
+ OpenAsync(placemark, new MapsLaunchOptions());
+
+ public static Task OpenAsync(Placemark placemark, MapsLaunchOptions options)
+ {
+ if (placemark == null)
+ throw new ArgumentNullException(nameof(placemark));
+
+ if (options == null)
+ throw new ArgumentNullException(nameof(options));
+
+ return PlatformOpenMapsAsync(placemark, options);
+ }
+ }
+}
diff --git a/Xamarin.Essentials/Maps/Maps.uwp.cs b/Xamarin.Essentials/Maps/Maps.uwp.cs
new file mode 100644
index 000000000..cc2c9a41a
--- /dev/null
+++ b/Xamarin.Essentials/Maps/Maps.uwp.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Globalization;
+using System.Threading.Tasks;
+
+namespace Xamarin.Essentials
+{
+ public static partial class Maps
+ {
+ internal static Task PlatformOpenMapsAsync(double latitude, double longitude, MapsLaunchOptions options)
+ {
+ return LaunchUri(new Uri(
+ $"bingmaps:?collection=point." +
+ $"{latitude.ToString(CultureInfo.InvariantCulture)}" +
+ $"_" +
+ $"{longitude.ToString(CultureInfo.InvariantCulture)}" +
+ $"_" +
+ $"{options.Name ?? string.Empty}"));
+ }
+
+ internal static Task PlatformOpenMapsAsync(Placemark placemark, MapsLaunchOptions options)
+ {
+ placemark = placemark.Escape();
+
+ var uri = new Uri(
+ $"bingmaps:?where=" +
+ $"{placemark.Thoroughfare}" +
+ $"%20{placemark.Locality}" +
+ $"%20{placemark.AdminArea}" +
+ $"%20{placemark.CountryName}");
+
+ return LaunchUri(uri);
+ }
+
+ static Task LaunchUri(Uri mapsUri) =>
+ Windows.System.Launcher.LaunchUriAsync(mapsUri).AsTask();
+ }
+}
diff --git a/Xamarin.Essentials/SecureStorage/SecureStorage.android.cs b/Xamarin.Essentials/SecureStorage/SecureStorage.android.cs
index afa318a49..0e2262342 100644
--- a/Xamarin.Essentials/SecureStorage/SecureStorage.android.cs
+++ b/Xamarin.Essentials/SecureStorage/SecureStorage.android.cs
@@ -177,7 +177,9 @@ KeyPair GetAsymmetricKeyPair()
var end = DateTime.UtcNow.AddYears(20);
var startDate = new Java.Util.Date();
+#pragma warning disable CS0618 // Type or member is obsolete
var endDate = new Java.Util.Date(end.Year, end.Month, end.Day);
+#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning disable CS0618
var builder = new KeyPairGeneratorSpec.Builder(Platform.AppContext)
diff --git a/Xamarin.Essentials/Types/LocationExtensions.shared.cs b/Xamarin.Essentials/Types/LocationExtensions.shared.cs
index 594615ca0..ac48559eb 100644
--- a/Xamarin.Essentials/Types/LocationExtensions.shared.cs
+++ b/Xamarin.Essentials/Types/LocationExtensions.shared.cs
@@ -1,8 +1,16 @@
-namespace Xamarin.Essentials
+using System.Threading.Tasks;
+
+namespace Xamarin.Essentials
{
public static partial class LocationExtensions
{
public static double CalculateDistance(this Location locationStart, Location locationEnd, DistanceUnits units) =>
Location.CalculateDistance(locationStart, locationEnd, units);
+
+ public static Task OpenMapsAsync(this Location location, MapsLaunchOptions options) =>
+ Maps.OpenAsync(location, options);
+
+ public static Task OpenMapsAsync(this Location location) =>
+ Maps.OpenAsync(location);
}
}
diff --git a/Xamarin.Essentials/Types/PlacemarkExtensions.android.cs b/Xamarin.Essentials/Types/PlacemarkExtensions.android.cs
index 5f05acc2e..5c0b1bc25 100644
--- a/Xamarin.Essentials/Types/PlacemarkExtensions.android.cs
+++ b/Xamarin.Essentials/Types/PlacemarkExtensions.android.cs
@@ -5,7 +5,7 @@
namespace Xamarin.Essentials
{
- internal static partial class PlacemarkExtensions
+ public static partial class PlacemarkExtensions
{
internal static IEnumerable ToPlacemarks(this IEnumerable addresses)
{
diff --git a/Xamarin.Essentials/Types/PlacemarkExtensions.ios.cs b/Xamarin.Essentials/Types/PlacemarkExtensions.ios.cs
index 0ed8c834d..12949e055 100644
--- a/Xamarin.Essentials/Types/PlacemarkExtensions.ios.cs
+++ b/Xamarin.Essentials/Types/PlacemarkExtensions.ios.cs
@@ -4,7 +4,7 @@
namespace Xamarin.Essentials
{
- internal static partial class PlacemarkExtensions
+ public static partial class PlacemarkExtensions
{
internal static IEnumerable ToPlacemarks(this IEnumerable addresses)
{
diff --git a/Xamarin.Essentials/Types/PlacemarkExtensions.shared.cs b/Xamarin.Essentials/Types/PlacemarkExtensions.shared.cs
index c9da7a6b3..421e06550 100644
--- a/Xamarin.Essentials/Types/PlacemarkExtensions.shared.cs
+++ b/Xamarin.Essentials/Types/PlacemarkExtensions.shared.cs
@@ -1,6 +1,38 @@
-namespace Xamarin.Essentials
+using System;
+using System.Threading.Tasks;
+
+namespace Xamarin.Essentials
{
- internal static partial class PlacemarkExtensions
+ public static partial class PlacemarkExtensions
{
+ public static Task OpenMapsAsync(this Placemark placemark, MapsLaunchOptions options) =>
+ Maps.OpenAsync(placemark, options);
+
+ public static Task OpenMapsAsync(this Placemark placemark) =>
+ Maps.OpenAsync(placemark);
+
+ internal static Placemark Escape(this Placemark placemark)
+ {
+ if (placemark == null)
+ throw new ArgumentNullException(nameof(placemark));
+ var escaped = new Placemark();
+
+ if (placemark.Location == null)
+ escaped.Location = new Location();
+ else
+ escaped.Location = new Location(placemark.Location);
+
+ escaped.CountryCode = string.IsNullOrWhiteSpace(placemark.CountryCode) ? string.Empty : Uri.EscapeUriString(placemark.CountryCode);
+ escaped.CountryName = string.IsNullOrWhiteSpace(placemark.CountryName) ? string.Empty : Uri.EscapeUriString(placemark.CountryName);
+ escaped.FeatureName = string.IsNullOrWhiteSpace(placemark.FeatureName) ? string.Empty : Uri.EscapeUriString(placemark.FeatureName);
+ escaped.PostalCode = string.IsNullOrWhiteSpace(placemark.PostalCode) ? string.Empty : Uri.EscapeUriString(placemark.PostalCode);
+ escaped.Locality = string.IsNullOrWhiteSpace(placemark.Locality) ? string.Empty : Uri.EscapeUriString(placemark.Locality);
+ escaped.SubLocality = string.IsNullOrWhiteSpace(placemark.SubLocality) ? string.Empty : Uri.EscapeUriString(placemark.SubLocality);
+ escaped.Thoroughfare = string.IsNullOrWhiteSpace(placemark.Thoroughfare) ? string.Empty : Uri.EscapeUriString(placemark.Thoroughfare);
+ escaped.SubThoroughfare = string.IsNullOrWhiteSpace(placemark.SubThoroughfare) ? string.Empty : Uri.EscapeUriString(placemark.SubThoroughfare);
+ escaped.SubAdminArea = string.IsNullOrWhiteSpace(placemark.SubAdminArea) ? string.Empty : Uri.EscapeUriString(placemark.SubAdminArea);
+ escaped.AdminArea = string.IsNullOrWhiteSpace(placemark.AdminArea) ? string.Empty : Uri.EscapeUriString(placemark.AdminArea);
+ return escaped;
+ }
}
}
diff --git a/Xamarin.Essentials/Xamarin.Essentials.csproj b/Xamarin.Essentials/Xamarin.Essentials.csproj
index e39cff4f1..0b3080cf5 100644
--- a/Xamarin.Essentials/Xamarin.Essentials.csproj
+++ b/Xamarin.Essentials/Xamarin.Essentials.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/Xamarin.Essentials/mdoc.targets b/Xamarin.Essentials/mdoc.targets
index da98a357b..9e7f9a816 100644
--- a/Xamarin.Essentials/mdoc.targets
+++ b/Xamarin.Essentials/mdoc.targets
@@ -39,7 +39,7 @@
+ Command="$(_ManagedExeLauncher) "$(MDocToolPath)" export-msxdoc --debug --out="$(MDocOutputPath)" "$(MDocDocumentationDirectory)"" />