/// <summary> /// Converts raw geojson coordinates for a single point into a Point class (xamarin point). /// </summary> /// <param name="coords">A single point to convert.</param> /// <returns></returns> private Point JsonCoordToXamarinPoint(object[] coords) { double latitude = (double)coords[0]; double longitude = (double)coords[1]; double altitude = (coords.Length == 3) ? (double)coords[2] : 0.0; Point point = new Point(latitude, longitude, altitude); AppConstants.RoundGPSPosition(point); return(point); }
/// <summary> /// Saves a new or edited feature to the embedded file. /// </summary> async void OnSaveUpdateActivated() { // Ensure geolocation points are only accurate up to the specified digit precision. foreach (var point in GeolocationPoints) { AppConstants.RoundGPSPosition(point); } // Do validation checks here. if (await FeatureEntryIsValid() == false) { return; } Feature featureToSave = CreateFeatureFromInput(); await App.FeaturesManager.SaveFeatureAsync(featureToSave); await HomePage.Instance.Navigation.PopAsync(); }