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 co-ordinates
24 public class Geocoordinates : IDisposable
26 internal Interop.CoordinatesHandle handle;
29 /// Constructs map coordinate object
31 /// <param name="latitude">latitude value, must be between (-90.0 ~ 90.0) degrees</param>
32 /// <param name="longitude">longitude value, must be between (-180.0 ~ 180.0) degrees</param>
33 /// <exception cref="System.ArgumentException">Throws if values for latitude and longitude are not valid</exception>
34 /// <exception cref="System.InvalidOperationException">Throws if native operation failed to allocate memory</exception>
35 public Geocoordinates(double latitude, double longitude)
37 handle = new Interop.CoordinatesHandle(latitude, longitude);
40 internal Geocoordinates(Interop.CoordinatesHandle nativeHandle)
42 handle = nativeHandle;
46 /// Latitude for this coordinate
48 public double Latitude
52 return handle.Latitude;
57 /// Longitude for this coordinate
59 public double Longitude
63 return handle.Longitude;
67 public override string ToString()
69 return $"[{Latitude}, {Longitude}]";
72 #region IDisposable Support
73 private bool _disposedValue = false;
75 protected virtual void Dispose(bool disposing)
80 _disposedValue = true;