summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLMultiPoint.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLMultiPoint.mm')
-rw-r--r--platform/darwin/src/MGLMultiPoint.mm13
1 files changed, 11 insertions, 2 deletions
diff --git a/platform/darwin/src/MGLMultiPoint.mm b/platform/darwin/src/MGLMultiPoint.mm
index d4518e3d8f..19aacaea43 100644
--- a/platform/darwin/src/MGLMultiPoint.mm
+++ b/platform/darwin/src/MGLMultiPoint.mm
@@ -3,6 +3,7 @@
#import "MGLShape_Private.h"
#import "NSCoder+MGLAdditions.h"
#import "MGLTypes.h"
+#import "MGLLoggingConfiguration_Private.h"
@implementation MGLMultiPoint
{
@@ -12,6 +13,7 @@
- (instancetype)initWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count
{
+ MGLLogDebug(@"Initializing with %lu coordinates.", (unsigned long) count);
self = [super init];
if (self)
@@ -28,6 +30,7 @@
- (instancetype)initWithCoder:(NSCoder *)decoder
{
+ MGLLogInfo(@"Initializing with coder.");
if (self = [super initWithCoder:decoder]) {
_coordinates = [decoder mgl_decodeLocationCoordinates2DForKey:@"coordinates"];
}
@@ -61,7 +64,7 @@
- (CLLocationCoordinate2D)coordinate
{
- NSAssert([self pointCount] > 0, @"A multipoint must have coordinates");
+ MGLAssert([self pointCount] > 0, @"A multipoint must have coordinates");
return _coordinates.at(0);
}
@@ -93,6 +96,7 @@
}
- (void)setCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count {
+ MGLLogDebug(@"Setting: %lu coordinates.", (unsigned long)count);
if (!count) {
[NSException raise:NSInvalidArgumentException
format:@"A multipoint must have at least one vertex."];
@@ -105,6 +109,7 @@
}
- (void)insertCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count atIndex:(NSUInteger)index {
+ MGLLogDebug(@"Inserting %lu coordinates at index %lu.", (unsigned long)count, (unsigned long)index);
if (!count) {
return;
}
@@ -123,15 +128,18 @@
- (void)appendCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count
{
+ MGLLogDebug(@"Appending %lu coordinates.", (unsigned long)count);
[self insertCoordinates:coords count:count atIndex:_coordinates.size()];
}
- (void)replaceCoordinatesInRange:(NSRange)range withCoordinates:(const CLLocationCoordinate2D *)coords
{
+ MGLLogDebug(@"Replacing coordinates in range: %@", NSStringFromRange(range));
[self replaceCoordinatesInRange:range withCoordinates:coords count:range.length];
}
- (void)replaceCoordinatesInRange:(NSRange)range withCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count {
+ MGLLogDebug(@"Replacing %lu coordinates in range %@.", (unsigned long)count, NSStringFromRange(range));
if (!count && !range.length) {
return;
}
@@ -154,6 +162,7 @@
}
- (void)removeCoordinatesInRange:(NSRange)range {
+ MGLLogDebug(@"Removing coordinatesInRange: %@", NSStringFromRange(range));
CLLocationCoordinate2D coords;
[self replaceCoordinatesInRange:range withCoordinates:&coords count:0];
}
@@ -181,7 +190,7 @@
- (mbgl::Annotation)annotationObjectWithDelegate:(__unused id <MGLMultiPointDelegate>)delegate
{
- NSAssert(NO, @"Cannot add an annotation from an instance of %@", NSStringFromClass([self class]));
+ MGLAssert(NO, @"Cannot add an annotation from an instance of %@", NSStringFromClass([self class]));
return mbgl::SymbolAnnotation(mbgl::Point<double>());
}