summaryrefslogtreecommitdiff
path: root/platform/darwin/test
diff options
context:
space:
mode:
authorJesse Bounds <jesse@rebounds.net>2016-12-09 16:09:10 -0800
committerGitHub <noreply@github.com>2016-12-09 16:09:10 -0800
commit7f75eb5d6ae014391f3baf066a9873c5fb1c1ded (patch)
tree0451999a6d5397a806dc3214bc5e0b8eb9b51daa /platform/darwin/test
parentce1d9ff5eee2df57ec4c2d1f39b967ecfef4b9bc (diff)
downloadqtlocation-mapboxgl-7f75eb5d6ae014391f3baf066a9873c5fb1c1ded.tar.gz
[ios, macos] Rename MGLGeoJSONSource to MGLShapeSource (#7334)
Diffstat (limited to 'platform/darwin/test')
-rw-r--r--platform/darwin/test/MGLCircleStyleLayerTests.m2
-rw-r--r--platform/darwin/test/MGLFillStyleLayerTests.m2
-rw-r--r--platform/darwin/test/MGLFilterTests.mm4
-rw-r--r--platform/darwin/test/MGLLineStyleLayerTests.m2
-rw-r--r--platform/darwin/test/MGLRasterStyleLayerTests.m2
-rw-r--r--platform/darwin/test/MGLShapeSourceTests.mm (renamed from platform/darwin/test/MGLGeoJSONSourceTests.mm)68
-rw-r--r--platform/darwin/test/MGLStyleTests.mm10
-rw-r--r--platform/darwin/test/MGLStyleValueTests.swift6
-rw-r--r--platform/darwin/test/MGLSymbolStyleLayerTests.m2
9 files changed, 49 insertions, 49 deletions
diff --git a/platform/darwin/test/MGLCircleStyleLayerTests.m b/platform/darwin/test/MGLCircleStyleLayerTests.m
index 432d3ffa79..f98e731354 100644
--- a/platform/darwin/test/MGLCircleStyleLayerTests.m
+++ b/platform/darwin/test/MGLCircleStyleLayerTests.m
@@ -11,7 +11,7 @@
- (void)testCircleLayer {
NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
NSURL *url = [NSURL fileURLWithPath:filePath];
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
[self.mapView.style addSource:source];
MGLCircleStyleLayer *layer = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
[self.mapView.style addLayer:layer];
diff --git a/platform/darwin/test/MGLFillStyleLayerTests.m b/platform/darwin/test/MGLFillStyleLayerTests.m
index 87846302ea..dd16214a71 100644
--- a/platform/darwin/test/MGLFillStyleLayerTests.m
+++ b/platform/darwin/test/MGLFillStyleLayerTests.m
@@ -11,7 +11,7 @@
- (void)testFillLayer {
NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
NSURL *url = [NSURL fileURLWithPath:filePath];
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
[self.mapView.style addSource:source];
MGLFillStyleLayer *layer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
[self.mapView.style addLayer:layer];
diff --git a/platform/darwin/test/MGLFilterTests.mm b/platform/darwin/test/MGLFilterTests.mm
index b18400f83a..4b393fd1dc 100644
--- a/platform/darwin/test/MGLFilterTests.mm
+++ b/platform/darwin/test/MGLFilterTests.mm
@@ -5,7 +5,7 @@
@interface MGLFilterTests : MGLStyleLayerTests {
- MGLGeoJSONSource *source;
+ MGLShapeSource *source;
MGLLineStyleLayer *layer;
}
@end
@@ -18,7 +18,7 @@
NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
NSURL *url = [NSURL fileURLWithPath:filePath];
NSData *geoJSONData = [NSData dataWithContentsOfURL:url];
- source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"test-source" geoJSONData:geoJSONData options:nil];
+ source = [[MGLShapeSource alloc] initWithIdentifier:@"test-source" geoJSONData:geoJSONData options:nil];
[self.mapView.style addSource:source];
layer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"test-layer" source:source];
}
diff --git a/platform/darwin/test/MGLLineStyleLayerTests.m b/platform/darwin/test/MGLLineStyleLayerTests.m
index e313b55bc7..49dd1f2198 100644
--- a/platform/darwin/test/MGLLineStyleLayerTests.m
+++ b/platform/darwin/test/MGLLineStyleLayerTests.m
@@ -11,7 +11,7 @@
- (void)testLineLayer {
NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
NSURL *url = [NSURL fileURLWithPath:filePath];
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
[self.mapView.style addSource:source];
MGLLineStyleLayer *layer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
[self.mapView.style addLayer:layer];
diff --git a/platform/darwin/test/MGLRasterStyleLayerTests.m b/platform/darwin/test/MGLRasterStyleLayerTests.m
index 197f1d4723..485664c986 100644
--- a/platform/darwin/test/MGLRasterStyleLayerTests.m
+++ b/platform/darwin/test/MGLRasterStyleLayerTests.m
@@ -11,7 +11,7 @@
- (void)testRasterLayer {
NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
NSURL *url = [NSURL fileURLWithPath:filePath];
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
[self.mapView.style addSource:source];
MGLRasterStyleLayer *layer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
[self.mapView.style addLayer:layer];
diff --git a/platform/darwin/test/MGLGeoJSONSourceTests.mm b/platform/darwin/test/MGLShapeSourceTests.mm
index 47f12828eb..c4273e6e3f 100644
--- a/platform/darwin/test/MGLGeoJSONSourceTests.mm
+++ b/platform/darwin/test/MGLShapeSourceTests.mm
@@ -2,26 +2,26 @@
#import <Mapbox/Mapbox.h>
#import "MGLFeature_Private.h"
-#import "MGLGeoJSONSource_Private.h"
+#import "MGLShapeSource_Private.h"
#import "MGLSource_Private.h"
#include <mbgl/style/sources/geojson_source.hpp>
-@interface MGLGeoJSONSourceTests : XCTestCase
+@interface MGLShapeSourceTests : XCTestCase
@end
-@implementation MGLGeoJSONSourceTests
+@implementation MGLShapeSourceTests
-- (void)testMGLGeoJSONSourceWithOptions {
+- (void)testMGLShapeSourceWithOptions {
NSURL *url = [NSURL URLWithString:@"http://www.mapbox.com/source"];
- NSDictionary *options = @{MGLGeoJSONSourceOptionClustered: @YES,
- MGLGeoJSONSourceOptionClusterRadius: @42,
- MGLGeoJSONSourceOptionMaximumZoomLevelForClustering: @98,
- MGLGeoJSONSourceOptionMaximumZoomLevel: @99,
- MGLGeoJSONSourceOptionBuffer: @1976,
- MGLGeoJSONSourceOptionSimplificationTolerance: @0.42};
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"source-id" URL:url options:options];
+ NSDictionary *options = @{MGLShapeSourceOptionClustered: @YES,
+ MGLShapeSourceOptionClusterRadius: @42,
+ MGLShapeSourceOptionMaximumZoomLevelForClustering: @98,
+ MGLShapeSourceOptionMaximumZoomLevel: @99,
+ MGLShapeSourceOptionBuffer: @1976,
+ MGLShapeSourceOptionSimplificationTolerance: @0.42};
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" URL:url options:options];
auto mbglOptions = [source geoJSONOptions];
XCTAssertTrue(mbglOptions.cluster);
@@ -31,21 +31,21 @@
XCTAssertEqual(mbglOptions.buffer, 1976);
XCTAssertEqual(mbglOptions.tolerance, 0.42);
- options = @{MGLGeoJSONSourceOptionClustered: @"number 1"};
- XCTAssertThrows([[MGLGeoJSONSource alloc] initWithIdentifier:@"source-id" URL:url options:options]);
+ options = @{MGLShapeSourceOptionClustered: @"number 1"};
+ XCTAssertThrows([[MGLShapeSource alloc] initWithIdentifier:@"source-id" URL:url options:options]);
}
- (void)testNilShape {
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"id" shape:nil options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"id" shape:nil options:nil];
XCTAssertNil(source.shape);
}
-- (void)testMGLGeoJSONSourceWithDataMultipleFeatures {
+- (void)testMGLShapeSourceWithDataMultipleFeatures {
NSString *geoJSON = @"{\"type\": \"FeatureCollection\",\"features\": [{\"type\": \"Feature\",\"properties\": {},\"geometry\": {\"type\": \"LineString\",\"coordinates\": [[-107.75390625,40.329795743702064],[-104.34814453125,37.64903402157866]]}}]}";
NSData *data = [geoJSON dataUsingEncoding:NSUTF8StringEncoding];
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"source-id" geoJSONData:data options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" geoJSONData:data options:nil];
MGLShapeCollection *collection = (MGLShapeCollection *)source.shape;
XCTAssertNotNil(collection);
@@ -53,25 +53,25 @@
XCTAssertTrue([collection.shapes.firstObject isMemberOfClass:[MGLPolylineFeature class]]);
}
-- (void)testMGLGeoJSONSourceWithSingleFeature {
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"geojson"
+- (void)testMGLShapeSourceWithSingleFeature {
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"geojson"
geoJSONData:[@"{\"type\": \"Point\", \"coordinates\": [0, 0]}" dataUsingEncoding:NSUTF8StringEncoding]
options:nil];
XCTAssertNotNil(source.shape);
XCTAssert([source.shape isKindOfClass:[MGLPointFeature class]]);
}
-- (void)testMGLGeoJSONSourceWithPolylineFeatures {
+- (void)testMGLShapeSourceWithPolylineFeatures {
CLLocationCoordinate2D coordinates[] = { CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(10, 10)};
MGLPolylineFeature *polylineFeature = [MGLPolylineFeature polylineWithCoordinates:coordinates count:2];
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"source-id" shape:polylineFeature options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" shape:polylineFeature options:nil];
XCTAssertNotNil(source.shape);
XCTAssertTrue([source.shape isMemberOfClass:[MGLPolylineFeature class]]);
}
-- (void)testMGLGeoJSONSourceWithPolygonFeatures {
+- (void)testMGLShapeSourceWithPolygonFeatures {
CLLocationCoordinate2D coordinates[] = {
CLLocationCoordinate2DMake(100.0, 0.0),
CLLocationCoordinate2DMake(101.0, 0.0),
@@ -101,7 +101,7 @@
@"array-of-array-attribute": arrayOfArrays,
@"array-of-dictionary-attribute": arrayOfDictionaries};
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"source-id" shape:polygonFeature options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" shape:polygonFeature options:nil];
XCTAssertNotNil(source.shape);
MGLPolygonFeature *expectedPolygonFeature = (MGLPolygonFeature *)source.shape;
@@ -117,7 +117,7 @@
XCTAssertEqualObjects(expectedPolygonFeature.attributes[@"array-of-dictionary-attribute"], arrayOfDictionaries);
}
-- (void)testMGLGeoJSONSourceWithPolygonFeaturesInculdingInteriorPolygons {
+- (void)testMGLShapeSourceWithPolygonFeaturesInculdingInteriorPolygons {
CLLocationCoordinate2D coordinates[] = {
CLLocationCoordinate2DMake(100.0, 0.0),
CLLocationCoordinate2DMake(101.0, 0.0),
@@ -136,26 +136,26 @@
MGLPolygonFeature *polygonFeature = [MGLPolygonFeature polygonWithCoordinates:coordinates count:5 interiorPolygons:@[polygon]];
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"source-id" shape:polygonFeature options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" shape:polygonFeature options:nil];
XCTAssertNotNil(source.shape);
XCTAssertTrue([source.shape isMemberOfClass:[MGLPolygonFeature class]]);
}
-- (void)testMGLGeoJSONSourceWithMultiPolylineFeatures {
+- (void)testMGLShapeSourceWithMultiPolylineFeatures {
CLLocationCoordinate2D firstCoordinates[] = { CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(10, 10)};
MGLPolylineFeature *firstPolylineFeature = [MGLPolylineFeature polylineWithCoordinates:firstCoordinates count:2];
CLLocationCoordinate2D secondCoordinates[] = { CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(10, 10)};
MGLPolylineFeature *secondPolylineFeature = [MGLPolylineFeature polylineWithCoordinates:secondCoordinates count:2];
MGLMultiPolylineFeature *multiPolylineFeature = [MGLMultiPolylineFeature multiPolylineWithPolylines:@[firstPolylineFeature, secondPolylineFeature]];
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"source-id" shape:multiPolylineFeature options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" shape:multiPolylineFeature options:nil];
XCTAssertNotNil(source.shape);
XCTAssertTrue([source.shape isMemberOfClass:[MGLMultiPolylineFeature class]]);
}
-- (void)testMGLGeoJSONSourceWithMultiPolygonFeatures {
+- (void)testMGLShapeSourceWithMultiPolygonFeatures {
CLLocationCoordinate2D coordinates[] = {
CLLocationCoordinate2DMake(100.0, 0.0),
CLLocationCoordinate2DMake(101.0, 0.0),
@@ -177,23 +177,23 @@
MGLMultiPolygonFeature *multiPolygonFeature = [MGLMultiPolygonFeature multiPolygonWithPolygons:@[firstPolygon, secondPolygon]];
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"source-id" shape:multiPolygonFeature options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" shape:multiPolygonFeature options:nil];
XCTAssertNotNil(source.shape);
XCTAssertTrue([source.shape isMemberOfClass:[MGLMultiPolygonFeature class]]);
}
-- (void)testMGLGeoJSONSourceWithPointFeature {
+- (void)testMGLShapeSourceWithPointFeature {
MGLPointFeature *pointFeature = [MGLPointFeature new];
pointFeature.coordinate = CLLocationCoordinate2DMake(100.2, 0.2);
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"souce-id" shape:pointFeature options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"souce-id" shape:pointFeature options:nil];
XCTAssertNotNil(source.shape);
XCTAssertTrue([source.shape isMemberOfClass:[MGLPointFeature class]]);
}
-- (void)testMGLGeoJSONSourceWithPointCollectionFeature {
+- (void)testMGLShapeSourceWithPointCollectionFeature {
CLLocationCoordinate2D coordinates[] = {
CLLocationCoordinate2DMake(100.0, 0.0),
CLLocationCoordinate2DMake(101.0, 0.0),
@@ -201,13 +201,13 @@
CLLocationCoordinate2DMake(100.0, 1.0),
CLLocationCoordinate2DMake(100.0, 0.0)};
MGLPointCollectionFeature *pointCollectionFeature = [MGLPointCollectionFeature pointCollectionWithCoordinates:coordinates count:5];
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"souce-id" shape:pointCollectionFeature options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"souce-id" shape:pointCollectionFeature options:nil];
XCTAssertNotNil(source.shape);
XCTAssertTrue([source.shape isMemberOfClass:[MGLPointCollectionFeature class]]);
}
-- (void)testMGLGeoJSONSourceWithShapeCollectionFeatures {
+- (void)testMGLShapeSourceWithShapeCollectionFeatures {
CLLocationCoordinate2D coordinates[] = {
CLLocationCoordinate2DMake(100.0, 0.0),
CLLocationCoordinate2DMake(101.0, 0.0),
@@ -243,7 +243,7 @@
MGLShapeCollectionFeature *shapeCollectionFeature_1 = [MGLShapeCollectionFeature shapeCollectionWithShapes:@[polygonFeature, polylineFeature, multiPolygonFeature, multiPolylineFeature, pointCollectionFeature, pointFeature, shapeCollectionFeature]];
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"source-id" shape:shapeCollectionFeature_1 options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" shape:shapeCollectionFeature_1 options:nil];
MGLShapeCollectionFeature *shape = (MGLShapeCollectionFeature *)source.shape;
diff --git a/platform/darwin/test/MGLStyleTests.mm b/platform/darwin/test/MGLStyleTests.mm
index ae55951fd9..f2151988b9 100644
--- a/platform/darwin/test/MGLStyleTests.mm
+++ b/platform/darwin/test/MGLStyleTests.mm
@@ -1,7 +1,7 @@
#import "MGLMapView.h"
#import "MGLStyle_Private.h"
-#import "MGLGeoJSONSource.h"
+#import "MGLShapeSource.h"
#import "MGLRasterSource.h"
#import "MGLVectorSource.h"
@@ -121,9 +121,9 @@
}
- (void)testAddingSourcesTwice {
- MGLGeoJSONSource *geoJSONSource = [[MGLGeoJSONSource alloc] initWithIdentifier:@"geoJSONSource" shape:nil options:nil];
- [self.style addSource:geoJSONSource];
- XCTAssertThrowsSpecificNamed([self.style addSource:geoJSONSource], NSException, @"MGLRedundantSourceException");
+ MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"geoJSONSource" shape:nil options:nil];
+ [self.style addSource:shapeSource];
+ XCTAssertThrowsSpecificNamed([self.style addSource:shapeSource], NSException, @"MGLRedundantSourceException");
MGLRasterSource *rasterSource = [[MGLRasterSource alloc] initWithIdentifier:@"rasterSource" URL:[NSURL new] tileSize:42];
[self.style addSource:rasterSource];
@@ -143,7 +143,7 @@
}
- (void)testAddingLayersTwice {
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"geoJSONSource" shape:nil options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"geoJSONSource" shape:nil options:nil];
MGLBackgroundStyleLayer *backgroundLayer = [[MGLBackgroundStyleLayer alloc] initWithIdentifier:@"backgroundLayer"];
[self.style addLayer:backgroundLayer];
diff --git a/platform/darwin/test/MGLStyleValueTests.swift b/platform/darwin/test/MGLStyleValueTests.swift
index 7a266a495f..2d2792fdc0 100644
--- a/platform/darwin/test/MGLStyleValueTests.swift
+++ b/platform/darwin/test/MGLStyleValueTests.swift
@@ -5,8 +5,8 @@ import Mapbox
extension MGLStyleValueTests {
func testConstantValues() {
- let geoJSONSource = MGLGeoJSONSource(identifier: "test", shape: nil, options: nil)
- let symbolStyleLayer = MGLSymbolStyleLayer(identifier: "test", source: geoJSONSource)
+ let shapeSource = MGLShapeSource(identifier: "test", shape: nil, options: nil)
+ let symbolStyleLayer = MGLSymbolStyleLayer(identifier: "test", source: shapeSource)
// Boolean
symbolStyleLayer.iconAllowOverlap = MGLStyleConstantValue(rawValue: true)
@@ -22,7 +22,7 @@ extension MGLStyleValueTests {
}
func testFunctions() {
- let geoJSONSource = MGLGeoJSONSource(identifier: "test", shape: nil, options: nil)
+ let geoJSONSource = MGLShapeSource(identifier: "test", shape: nil, options: nil)
let symbolStyleLayer = MGLSymbolStyleLayer(identifier: "test", source: geoJSONSource)
// Boolean
diff --git a/platform/darwin/test/MGLSymbolStyleLayerTests.m b/platform/darwin/test/MGLSymbolStyleLayerTests.m
index 13019ffdfc..fc8d848a0a 100644
--- a/platform/darwin/test/MGLSymbolStyleLayerTests.m
+++ b/platform/darwin/test/MGLSymbolStyleLayerTests.m
@@ -11,7 +11,7 @@
- (void)testSymbolLayer {
NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
NSURL *url = [NSURL fileURLWithPath:filePath];
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
+ MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
[self.mapView.style addSource:source];
MGLSymbolStyleLayer *layer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
[self.mapView.style addLayer:layer];