[core] Fix LatLngBounds default coordinates
LatLngBounds southwest and northeast coordinate points were inverted, so they could be extended via LatLngBounds::extend(). However, this looks confusing and error-prone. A static LatLngBounds::getExtendable() is added to address cases when we want to extend LatLngBounds.
This commit is contained in:
@@ -41,12 +41,19 @@ struct ProjectedMeters {
|
||||
};
|
||||
|
||||
struct LatLngBounds {
|
||||
LatLng sw = {90, 180};
|
||||
LatLng ne = {-90, -180};
|
||||
LatLng sw = {-90, -180};
|
||||
LatLng ne = {90, 180};
|
||||
|
||||
inline LatLngBounds(const LatLng& sw_ = {90, 180}, const LatLng& ne_ = {-90, -180})
|
||||
inline LatLngBounds() {}
|
||||
|
||||
inline LatLngBounds(const LatLng& sw_, const LatLng& ne_)
|
||||
: sw(sw_), ne(ne_) {}
|
||||
|
||||
static inline LatLngBounds getExtendable() {
|
||||
LatLngBounds bounds;
|
||||
return { bounds.ne, bounds.sw };
|
||||
}
|
||||
|
||||
inline operator bool() const {
|
||||
return sw && ne;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user