This repository has been archived on 2022-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
DevOpsOpenHack/MobileApps/MyDriving/MyDriving.Android/Helpers/AndroidExtensions.cs
2022-11-03 16:41:13 -04:00

21 lines
763 B
C#

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for details.
using Android.Gms.Maps.Model;
using MyDriving.DataObjects;
using System.Collections.Generic;
using System.Linq;
namespace MyDriving.Droid.Helpers
{
public static class LocationExtensions
{
public static LatLng ToLatLng(this TripPoint point) => new LatLng(point.Latitude, point.Longitude);
public static LatLng ToLatLng(this Plugin.Geolocator.Abstractions.Position point)
=> new LatLng(point.Latitude, point.Longitude);
public static List<LatLng> ToLatLngs(this IEnumerable<TripPoint> points)
=> new List<LatLng>(points.Select(s => s.ToLatLng()));
}
}