2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 /// Class representing geographical coordinates.
24 /// <since_tizen>3</since_tizen>
25 public class Geocoordinates : IDisposable
27 internal Interop.CoordinatesHandle handle;
30 /// Constructs map coordinates object.
32 /// <since_tizen>3</since_tizen>
33 /// <param name="latitude">Latitude value, must be between (-90.0 ~ 90.0) degrees</param>
34 /// <param name="longitude">Longitude value, must be between (-180.0 ~ 180.0) degrees</param>
35 /// <exception cref="System.ArgumentException">Thrown when values for latitude and longitude are not valid.</exception>
36 /// <exception cref="System.InvalidOperationException">Thrown when native operation failed to allocate memory.</exception>
37 public Geocoordinates(double latitude, double longitude)
39 handle = new Interop.CoordinatesHandle(latitude, longitude);
42 internal Geocoordinates(Interop.CoordinatesHandle nativeHandle)
44 handle = nativeHandle;
48 /// Gets latitude of the coordinates.
50 /// <since_tizen>3</since_tizen>
51 public double Latitude
55 return handle.Latitude;
60 /// Gets longitude of the coordinates.
62 /// <since_tizen>3</since_tizen>
63 public double Longitude
67 return handle.Longitude;
72 /// Returns a string that represents this object.
74 /// <since_tizen>3</since_tizen>
75 /// <returns>Returns a string which presents this object.</returns>
76 public override string ToString()
78 return $"[{Latitude}, {Longitude}]";
81 #region IDisposable Support
82 private bool _disposedValue = false;
84 protected virtual void Dispose(bool disposing)
89 _disposedValue = true;
94 /// Releases all resources used by this object.
96 /// <since_tizen>3</since_tizen>
100 GC.SuppressFinalize(this);