summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/jni.cpp4
-rw-r--r--platform/ios/MGLMapView.mm6
-rw-r--r--platform/ios/MGLMultiPoint.mm1
3 files changed, 5 insertions, 6 deletions
diff --git a/platform/android/jni.cpp b/platform/android/jni.cpp
index 1e4c4c05f3..9b80013da2 100644
--- a/platform/android/jni.cpp
+++ b/platform/android/jni.cpp
@@ -1186,9 +1186,7 @@ jlongArray JNICALL nativeGetAnnotationsInBounds(JNIEnv *env, jobject obj, jlong
return nullptr;
}
- mbgl::LatLngBounds bounds;
- bounds.sw = { swLat, swLon };
- bounds.ne = { neLat, neLon };
+ mbgl::LatLngBounds bounds({ swLat, swLon }, { neLat, neLon });
// assume only points for now
std::vector<uint32_t> annotations = nativeMapView->getMap().getPointAnnotationsInBounds(bounds);
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm
index 750f3fabbb..81ec18bb7c 100644
--- a/platform/ios/MGLMapView.mm
+++ b/platform/ios/MGLMapView.mm
@@ -1099,7 +1099,7 @@ std::chrono::steady_clock::duration durationInSeconds(float duration)
// figure out what that means in coordinate space
CLLocationCoordinate2D coordinate;
- mbgl::LatLngBounds tapBounds;
+ mbgl::LatLngBounds tapBounds = mbgl::LatLngBounds::getExtendable();
coordinate = [self convertPoint:tapRectLowerLeft toCoordinateFromView:self];
tapBounds.extend(MGLLatLngFromLocationCoordinate2D(coordinate));
@@ -1997,7 +1997,7 @@ CLLocationCoordinate2D MGLLocationCoordinate2DFromLatLng(mbgl::LatLng latLng)
- (mbgl::LatLngBounds)viewportBounds
{
- mbgl::LatLngBounds bounds;
+ mbgl::LatLngBounds bounds = mbgl::LatLngBounds::getExtendable();
bounds.extend(MGLLatLngFromLocationCoordinate2D(
[self convertPoint:CGPointMake(0, 0) toCoordinateFromView:self]));
@@ -2517,7 +2517,7 @@ CLLocationCoordinate2D MGLLocationCoordinate2DFromLatLng(mbgl::LatLng latLng)
{
if ( ! annotations || ! annotations.count) return;
- mbgl::LatLngBounds bounds;
+ mbgl::LatLngBounds bounds = mbgl::LatLngBounds::getExtendable();
for (id <MGLAnnotation> annotation in annotations)
{
diff --git a/platform/ios/MGLMultiPoint.mm b/platform/ios/MGLMultiPoint.mm
index 624c1658ad..702932f066 100644
--- a/platform/ios/MGLMultiPoint.mm
+++ b/platform/ios/MGLMultiPoint.mm
@@ -19,6 +19,7 @@
{
_count = count;
_coords = (CLLocationCoordinate2D *)malloc(_count * sizeof(CLLocationCoordinate2D));
+ _bounds = mbgl::LatLngBounds::getExtendable();
for (NSUInteger i = 0; i < _count; i++)
{