[core] Implement LatLng::null()

This commit is contained in:
Bruno de Oliveira Abinader
2016-03-13 19:04:59 +02:00
parent 8e30a4a080
commit fe7e208b42
3 changed files with 10 additions and 2 deletions

View File

@@ -14,11 +14,15 @@ using ScreenCoordinate = vec2<double>;
class LatLng {
public:
struct null {};
double latitude;
double longitude;
enum WrapMode : bool { Unwrapped, Wrapped };
LatLng(null) : latitude(std::numeric_limits<double>::quiet_NaN()), longitude(latitude) {}
LatLng(double lat = 0, double lon = 0, WrapMode mode = Unwrapped)
: latitude(lat), longitude(lon) { if (mode == Wrapped) wrap(); }