diff options
Diffstat (limited to 'src/mbgl/style/conversion/coordinate.cpp')
-rw-r--r-- | src/mbgl/style/conversion/coordinate.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mbgl/style/conversion/coordinate.cpp b/src/mbgl/style/conversion/coordinate.cpp index 9b2be3381e..20abd45e26 100644 --- a/src/mbgl/style/conversion/coordinate.cpp +++ b/src/mbgl/style/conversion/coordinate.cpp @@ -6,20 +6,20 @@ namespace conversion { optional<LatLng> Converter<LatLng>::operator() (const Convertible& value, Error& error) const { if (!isArray(value) || arrayLength(value) < 2 ) { - error = { "coordinate array must contain numeric longitude and latitude values" }; - return {}; + error.message = "coordinate array must contain numeric longitude and latitude values"; + return nullopt; } //Style spec uses GeoJSON convention for specifying coordinates optional<double> latitude = toDouble(arrayMember(value, 1)); optional<double> longitude = toDouble(arrayMember(value, 0)); if (!latitude || !longitude) { - error = { "coordinate array must contain numeric longitude and latitude values" }; - return {}; + error.message = "coordinate array must contain numeric longitude and latitude values"; + return nullopt; } if (*latitude < -90 || *latitude > 90 ){ - error = { "coordinate latitude must be between -90 and 90" }; - return {}; + error.message = "coordinate latitude must be between -90 and 90"; + return nullopt; } return LatLng(*latitude, *longitude); } |