Files
MapLibreParticleLab/platform/darwin/test/MGLSourceQueryTests.m
John Firebaugh 197751bace [core] Load source TileJSON immediately
This reverses #3095. Rationale:

* We're now exposing source attributes as a public API. Making those attributes unavailable at certain times complicates that API.
* We're preparing to split RenderSource out of Source. Removing this removes a point of coupling between the two.
2017-05-02 08:45:09 -07:00

26 lines
931 B
Objective-C

#import <Mapbox/Mapbox.h>
#import <XCTest/XCTest.h>
@interface MGLSourceQueryTests : XCTestCase <MGLMapViewDelegate>
@end
@implementation MGLSourceQueryTests
- (void) testQueryVectorSource {
MGLVectorSource *source = [[MGLVectorSource alloc] initWithIdentifier:@"vector" tileURLTemplates:@[@"fake"] options:nil];
NSSet *sourceLayers = [NSSet setWithObjects:@"buildings", @"water", nil];
NSArray* features = [source featuresInSourceLayersWithIdentifiers:sourceLayers predicate:nil];
// Source not added yet, so features is 0
XCTAssertEqual([features count], 0);
}
- (void) testQueryShapeSource {
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"shape" shape:[MGLShapeCollection shapeCollectionWithShapes:@[]] options:nil];
NSArray* features = [source featuresMatchingPredicate:nil];
// Source not added yet, so features is 0
XCTAssertEqual([features count], 0);
}
@end