summaryrefslogtreecommitdiff
path: root/platform/darwin/test/MGLTileSetTests.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/test/MGLTileSetTests.mm')
-rw-r--r--platform/darwin/test/MGLTileSetTests.mm14
1 files changed, 14 insertions, 0 deletions
diff --git a/platform/darwin/test/MGLTileSetTests.mm b/platform/darwin/test/MGLTileSetTests.mm
index 40eab5f974..4d5e1fcd05 100644
--- a/platform/darwin/test/MGLTileSetTests.mm
+++ b/platform/darwin/test/MGLTileSetTests.mm
@@ -2,6 +2,7 @@
#import <Mapbox/Mapbox.h>
#import "MGLTileSource_Private.h"
+#import "MGLGeometry_Private.h"
#include <mbgl/util/tileset.hpp>
@@ -40,6 +41,19 @@
XCTAssertEqual(tileSet.zoomRange.min, 1);
XCTAssertEqual(tileSet.zoomRange.max, 2);
+ // when the tile set has a bounds set
+ MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(12, 34), CLLocationCoordinate2DMake(56, 78));
+ tileSet = MGLTileSetFromTileURLTemplates(@[@"tile.1"], @{
+ MGLTileSourceOptionCoordinateBounds: @(bounds),
+ });
+
+ // the mbgl object reflects the set values for the bounds
+ XCTAssert(!!tileSet.bounds, @"The bounds are set after setting the bounds");
+ if (tileSet.bounds) {
+ MGLCoordinateBounds actual = MGLCoordinateBoundsFromLatLngBounds(*tileSet.bounds);
+ XCTAssert(MGLCoordinateBoundsEqualToCoordinateBounds(bounds, actual), @"The bounds round-trip");
+ }
+
// when the tile set has an attribution
NSString *attribution = @"my tileset © ©️🎈";
tileSet = MGLTileSetFromTileURLTemplates(tileURLTemplates, @{