Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Rename identifer -> identifier (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Rex authored Sep 16, 2020
1 parent 746a830 commit 2677bbb
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion platform/darwin/src/MGLFeature_Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ id <MGLFeature> MGLFeatureFromMBGLFeature(const mbgl::GeoJSONFeature &feature);
MGLShape* MGLShapeFromGeoJSON(const mapbox::geojson::geojson &geojson);

/**
Takes an `mbgl::GeoJSONFeature` object, an identifer, and attributes dictionary and
Takes an `mbgl::GeoJSONFeature` object, an identifier, and attributes dictionary and
returns the feature object with converted `mbgl::FeatureIdentifier` and
`mbgl::PropertyMap` properties.
*/
Expand Down
22 changes: 11 additions & 11 deletions platform/darwin/src/MGLStyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ This set does not include Mapbox Streets source identifiers, which are included
style URL to an explicitly versioned style using a convenience method like
`+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL”
inspectable in Interface Builder, or a manually constructed `NSURL`. This
approach also avoids source identifer name changes that will occur in the default
approach also avoids source identifier name changes that will occur in the default
style’s sources over time.
@return An instance of a concrete subclass of `MGLSource` associated with the
Expand Down Expand Up @@ -312,7 +312,7 @@ This set does not include Mapbox Streets source identifiers, which are included
style URL to an explicitly versioned style using a convenience method like
`+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL”
inspectable in Interface Builder, or a manually constructed `NSURL`. This
approach also avoids source identifer name changes that will occur in the default
approach also avoids source identifier name changes that will occur in the default
style’s sources over time.
@param source The source to remove from the current style.
Expand All @@ -327,7 +327,7 @@ This set does not include Mapbox Streets source identifiers, which are included
style URL to an explicitly versioned style using a convenience method like
`+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL”
inspectable in Interface Builder, or a manually constructed `NSURL`. This
approach also avoids source identifer name changes that will occur in the default
approach also avoids source identifier name changes that will occur in the default
style’s sources over time.
@param source The source to remove from the current style.
Expand Down Expand Up @@ -355,7 +355,7 @@ This set does not include Mapbox Streets source identifiers, which are included
the style URL to an explicitly versioned style using a convenience method like
`+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL”
inspectable in Interface Builder, or a manually constructed `NSURL`. This
approach also avoids layer identifer name changes that will occur in the default
approach also avoids layer identifier name changes that will occur in the default
style’s layers over time.
@return An instance of a concrete subclass of `MGLStyleLayer` associated with
Expand All @@ -368,7 +368,7 @@ This set does not include Mapbox Streets source identifiers, which are included
Adds a new layer on top of existing layers.
@note Adding the same layer instance more than once will result in a
`MGLRedundantLayerException`. Reusing the same layer identifer, even with
`MGLRedundantLayerException`. Reusing the same layer identifier, even with
different layer instances, will also result in an exception.
@note Layers should be added in
Expand All @@ -385,7 +385,7 @@ This set does not include Mapbox Streets source identifiers, which are included
Inserts a new layer into the style at the given index.
@note Adding the same layer instance more than once will result in a
`MGLRedundantLayerException`. Reusing the same layer identifer, even with
`MGLRedundantLayerException`. Reusing the same layer identifier, even with
different layer instances, will also result in an exception.
@note Layers should be added in
Expand All @@ -408,11 +408,11 @@ This set does not include Mapbox Streets source identifiers, which are included
the style URL to an explicitly versioned style using a convenience method like
`+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL”
inspectable in Interface Builder, or a manually constructed `NSURL`. This
approach also avoids layer identifer name changes that will occur in the default
approach also avoids layer identifier name changes that will occur in the default
style’s layers over time.
Inserting the same layer instance more than once will result in a
`MGLRedundantLayerException`. Reusing the same layer identifer, even with
`MGLRedundantLayerException`. Reusing the same layer identifier, even with
different layer instances, will also result in an exception.
@param layer The layer to insert.
Expand All @@ -433,11 +433,11 @@ This set does not include Mapbox Streets source identifiers, which are included
the style URL to an explicitly versioned style using a convenience method like
`+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL”
inspectable in Interface Builder, or a manually constructed `NSURL`. This
approach also avoids layer identifer name changes that will occur in the default
approach also avoids layer identifier name changes that will occur in the default
style’s layers over time.
Inserting the same layer instance more than once will result in a
`MGLRedundantLayerException`. Reusing the same layer identifer, even with
`MGLRedundantLayerException`. Reusing the same layer identifier, even with
different layer instances, will also result in an exception.
@param layer The layer to insert.
Expand All @@ -458,7 +458,7 @@ This set does not include Mapbox Streets source identifiers, which are included
the style URL to an explicitly versioned style using a convenience method like
`+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL”
inspectable in Interface Builder, or a manually constructed `NSURL`. This
approach also avoids layer identifer name changes that will occur in the default
approach also avoids layer identifier name changes that will occur in the default
style’s layers over time.
@param layer The layer object to remove from the map view. This object
Expand Down
2 changes: 1 addition & 1 deletion platform/darwin/src/MGLStyleLayer_Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct LayerWrapper {
format: \
@"Either this layer got invalidated after the style change or " \
@"-[MGLStyle removeLayer:] has been called " \
@"with this instance but another style layer instance was added with the same identifer. It is an " \
@"with this instance but another style layer instance was added with the same identifier. It is an " \
@"error to send any message to this layer since it cannot be recovered after removal due to the " \
@"identifier collision. Use unique identifiers for all layer instances including layers of " \
@"different types."]; \
Expand Down
4 changes: 2 additions & 2 deletions platform/darwin/test/MGLStyleTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ - (void)testAddingSourceOfTypeABeforeSourceOfTypeBWithSameIdentifier {
// Add the shape source
[self.style addSource:imageSource];

// Attempt to remove a vector tile source with the same identifer as the shape source
// Attempt to remove a vector tile source with the same identifier as the shape source
MGLVectorTileSource *vectorTileSource = [[MGLVectorTileSource alloc] initWithIdentifier:@"some-identifier" tileURLTemplates:@[] options:nil];
[self.style removeSource:vectorTileSource];
// The image source should still be added
Expand All @@ -221,7 +221,7 @@ - (void)testAddingSourceOfTypeABeforeSourceOfTypeBWithSameIdentifier {
// Add the vector tile source
[self.style addSource:vectorTileSource];

// Attempt to remove the previously created raster tile source that has the same identifer as the shape source
// Attempt to remove the previously created raster tile source that has the same identifier as the shape source
[self.style removeSource:rasterTileSource];
// The vector tile source should still be added
XCTAssertTrue([[self.style sourceWithIdentifier:imageSource.identifier] isMemberOfClass:[MGLVectorTileSource class]]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ - (void)internalTestOffscreenSelectionTitle:(NSString*)title withTestData:(PanTe

XCTAssert(self.mapView.annotations.count == 0);

NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReuseIdentifer";
NSString * const MGLTestAnnotationReuseIdentifier = @"MGLTestAnnotationReuseIdentifier";
CGSize size = self.mapView.bounds.size;
CGSize annotationSize = CGSizeMake(floor(size.width*kAnnotationRelativeScale.x), floor(size.height*kAnnotationRelativeScale.y));

Expand All @@ -81,7 +81,7 @@ - (void)internalTestOffscreenSelectionTitle:(NSString*)title withTestData:(PanTe
}

// No dequeue
MGLAnnotationView *annotationView = [[MGLAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:MGLTestAnnotationReuseIdentifer];
MGLAnnotationView *annotationView = [[MGLAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:MGLTestAnnotationReuseIdentifier];
annotationView.bounds = (CGRect){ .origin = CGPointZero, .size = annotationSize };
annotationView.backgroundColor = UIColor.redColor;
annotationView.enabled = YES;
Expand Down Expand Up @@ -428,7 +428,7 @@ - (void)testSelectingAnnotationWithCenterOffset {

- (void)internalTestSelectingAnnotationWithCenterOffsetWithOffset:(CGVector)offset edgeInsets:(UIEdgeInsets)edgeInsets {

NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReuseIdentifer";
NSString * const MGLTestAnnotationReuseIdentifier = @"MGLTestAnnotationReuseIdentifier";

self.mapView.contentInset = edgeInsets;
CGSize size = self.mapView.bounds.size;
Expand All @@ -442,7 +442,7 @@ - (void)internalTestSelectingAnnotationWithCenterOffsetWithOffset:(CGVector)offs
}

// No dequeue
MGLAnnotationView *annotationView = [[MGLAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:MGLTestAnnotationReuseIdentifer];
MGLAnnotationView *annotationView = [[MGLAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:MGLTestAnnotationReuseIdentifier];
annotationView.bounds = (CGRect){ .origin = CGPointZero, .size = annotationSize };
annotationView.backgroundColor = UIColor.redColor;
annotationView.enabled = YES;
Expand Down Expand Up @@ -692,7 +692,7 @@ - (NSArray*)internalAddAnnotationsAtCoordinates:(CLLocationCoordinate2D*)coordin
block:^(id<XCTActivity> _Nonnull activity)
{

NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReuseIdentifer";
NSString * const MGLTestAnnotationReuseIdentifier = @"MGLTestAnnotationReuseIdentifier";

CGSize annotationSize = CGSizeMake(40.0, 40.0);

Expand All @@ -703,7 +703,7 @@ - (NSArray*)internalAddAnnotationsAtCoordinates:(CLLocationCoordinate2D*)coordin
}

// No dequeue
MGLAnnotationView *annotationView = [[MGLAnnotationView alloc] initWithAnnotation:annotation2 reuseIdentifier:MGLTestAnnotationReuseIdentifer];
MGLAnnotationView *annotationView = [[MGLAnnotationView alloc] initWithAnnotation:annotation2 reuseIdentifier:MGLTestAnnotationReuseIdentifier];
annotationView.bounds = (CGRect){ .origin = CGPointZero, .size = annotationSize };
annotationView.backgroundColor = UIColor.redColor;
annotationView.enabled = YES;
Expand Down
6 changes: 3 additions & 3 deletions platform/ios/app/MBXViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
.ne = { .latitude = 40.989329, .longitude = -102.062592},
};

static NSString * const MBXViewControllerAnnotationViewReuseIdentifer = @"MBXViewControllerAnnotationViewReuseIdentifer";
static NSString * const MBXViewControllerAnnotationViewReuseIdentifier = @"MBXViewControllerAnnotationViewReuseIdentifier";

typedef NS_ENUM(NSInteger, MBXSettingsSections) {
MBXSettingsDebugTools = 0,
Expand Down Expand Up @@ -2063,10 +2063,10 @@ - (MGLAnnotationView *)mapView:(MGLMapView *)mapView viewForAnnotation:(id<MGLAn
return nil;
}

MBXAnnotationView *annotationView = (MBXAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:MBXViewControllerAnnotationViewReuseIdentifer];
MBXAnnotationView *annotationView = (MBXAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:MBXViewControllerAnnotationViewReuseIdentifier];
if (!annotationView)
{
annotationView = [[MBXAnnotationView alloc] initWithReuseIdentifier:MBXViewControllerAnnotationViewReuseIdentifer];
annotationView = [[MBXAnnotationView alloc] initWithReuseIdentifier:MBXViewControllerAnnotationViewReuseIdentifier];
annotationView.frame = CGRectMake(0, 0, 10, 10);
annotationView.backgroundColor = [UIColor whiteColor];

Expand Down
6 changes: 3 additions & 3 deletions platform/ios/src/MGLMapView.h
Original file line number Diff line number Diff line change
Expand Up @@ -1901,7 +1901,7 @@ MGL_EXPORT
the style URL to an explicitly versioned style using a convenience method
like `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL”
inspectable in Interface Builder, or a manually constructed `NSURL`. This
approach also avoids layer identifer name changes that will occur in the
approach also avoids layer identifier name changes that will occur in the
default style’s layers over time.
@param point A point expressed in the map view’s coordinate system.
Expand Down Expand Up @@ -1999,15 +1999,15 @@ MGL_EXPORT
style URL to an explicitly versioned style using a convenience method like
`+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL”
inspectable in Interface Builder, or a manually constructed `NSURL`. This
approach also avoids layer identifer name changes that will occur in the
approach also avoids layer identifier name changes that will occur in the
default style’s layers over time.
@note Layer identifiers are not guaranteed to exist across styles or different
versions of the same style. Applications that use this API must first set
the style URL to an explicitly versioned style using a convenience method
like `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL”
inspectable in Interface Builder, or a manually constructed `NSURL`. This
approach also avoids layer identifer name changes that will occur in the
approach also avoids layer identifier name changes that will occur in the
default style’s layers over time.
@param rect A rectangle expressed in the map view’s coordinate system.
Expand Down
6 changes: 3 additions & 3 deletions platform/ios/test/MGLAnnotationViewTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#import <XCTest/XCTest.h>
#import "MGLTestUtility.h"

static NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReuseIdentifer";
static NSString * const MGLTestAnnotationReuseIdentifier = @"MGLTestAnnotationReuseIdentifier";


@interface MGLMapView (Tests)
Expand Down Expand Up @@ -244,11 +244,11 @@ - (void)testSelectingADisabledAnnotationViewPENDING {

- (MGLAnnotationView *)mapView:(MGLMapView *)mapView viewForAnnotation:(id<MGLAnnotation>)annotation
{
MGLAnnotationView *annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:MGLTestAnnotationReuseIdentifer];
MGLAnnotationView *annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:MGLTestAnnotationReuseIdentifier];

if (!annotationView)
{
annotationView = [[MGLAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:MGLTestAnnotationReuseIdentifer];
annotationView = [[MGLAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:MGLTestAnnotationReuseIdentifier];
}

if (self.prepareAnnotationView) {
Expand Down

0 comments on commit 2677bbb

Please sign in to comment.