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 /// A class representing geographical coordinates.
24 /// <since_tizen> 3 </since_tizen>
25 public class Geocoordinates : IDisposable
27 internal Interop.CoordinatesHandle handle;
30 /// Constructs the 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 a native operation fails 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 the latitude coordinates.
50 /// <since_tizen> 3 </since_tizen>
51 public double Latitude
55 return handle.Latitude;
60 /// Gets the longitude 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 that represents this object.</returns>
76 public override string ToString()
78 return $"[{Latitude}, {Longitude}]";
81 #region IDisposable Support
82 private bool _disposedValue = false;
85 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
87 /// <param name="disposing">If true, managed and unmanaged resources can be disposed, otherwise only unmanaged resources can be disposed.</param>
88 protected virtual void Dispose(bool disposing)
93 _disposedValue = true;
98 /// Releases all the resources used by this object.
100 /// <since_tizen> 3 </since_tizen>
101 public void Dispose()
104 GC.SuppressFinalize(this);