Authored by Justin R. Miller

rename some properties to be more intuitive to use

... ... @@ -65,7 +65,7 @@
fillColor = kDefaultFillColor;
scaleLineWidth = NO;
enableDragging = YES;
draggingEnabled = YES;
circlePath = NULL;
[self updateCirclePathAnimated:NO];
... ...
... ... @@ -40,7 +40,7 @@
// expressed in projected meters. The anchorPoint of the image/path/etc. is plotted here.
RMProjectedPoint projectedLocation;
BOOL enableDragging;
BOOL draggingEnabled;
// provided for storage of arbitrary user data
id userInfo;
... ... @@ -55,7 +55,7 @@
@property (nonatomic, assign) RMProjectedPoint projectedLocation;
/** When set to YES, the layer can be dragged by the user. */
@property (nonatomic, assign) BOOL enableDragging;
@property (nonatomic, assign) BOOL draggingEnabled;
/** Storage for arbitrary data. */
@property (nonatomic, retain) id userInfo;
... ...
... ... @@ -32,7 +32,7 @@
@synthesize annotation;
@synthesize projectedLocation;
@synthesize enableDragging;
@synthesize draggingEnabled;
@synthesize userInfo;
@synthesize canShowCallout;
@synthesize calloutOffset;
... ... @@ -45,7 +45,7 @@
return nil;
self.annotation = nil;
self.enableDragging = NO;
self.draggingEnabled = NO;
self.calloutOffset = CGPointZero;
return self;
... ...
... ... @@ -86,14 +86,14 @@ typedef enum : NSUInteger {
* This property controls only user interactions with the map. If you set the value of this property to `NO`, you may still change the map location programmatically.
*
* The default value of this property is `YES`. */
@property (nonatomic, assign) BOOL enableDragging;
@property (nonatomic, assign) BOOL draggingEnabled;
/** A Boolean value that determines whether the map view bounces past the edge of content and back again and whether it animates the content scaling when the scaling exceeds the maximum or minimum limits.
*
* If the value of this property is `YES`, the map view bounces when it encounters a boundary of the content or when zooming exceeds either the maximum or minimum limits for scaling. Bouncing visually indicates that scrolling or zooming has reached an edge of the content. If the value is `NO`, scrolling and zooming stop immediately at the content boundary without bouncing.
*
* The default value is `NO`. */
@property (nonatomic, assign) BOOL enableBouncing;
@property (nonatomic, assign) BOOL bouncingEnabled;
/** A Boolean value that determines whether double-tap zooms of the map always zoom on the center of the map, or whether they zoom on the center of the double-tap gesture. The default value is `NO`, which zooms on the gesture. */
@property (nonatomic, assign) BOOL zoomingInPivotsAroundCenter;
... ... @@ -352,7 +352,7 @@ typedef enum : NSUInteger {
/** @name Configuring Annotation Clustering */
/** Whether to enable clustering of map point annotations. Defaults to `NO`. */
@property (nonatomic, assign) BOOL enableClustering;
@property (nonatomic, assign) BOOL clusteringEnabled;
/** Whether to position cluster markers at the weighted center of the points they represent. If `YES`, position clusters in weighted fashion. If `NO`, position them on a rectangular grid. Defaults to `NO`. */
@property (nonatomic, assign) BOOL positionClusterMarkersAtTheGravityCenter;
... ...
... ... @@ -163,7 +163,7 @@
CGSize _lastContentSize;
BOOL _mapScrollViewIsZooming;
BOOL _enableDragging, _enableBouncing;
BOOL _draggingEnabled, _bouncingEnabled;
CGPoint _lastDraggingTranslation;
RMAnnotation *_draggedAnnotation;
... ... @@ -200,7 +200,7 @@
@synthesize screenScale = _screenScale;
@synthesize tileCache = _tileCache;
@synthesize quadTree = _quadTree;
@synthesize enableClustering = _enableClustering;
@synthesize clusteringEnabled = _clusteringEnabled;
@synthesize positionClusterMarkersAtTheGravityCenter = _positionClusterMarkersAtTheGravityCenter;
@synthesize orderClusterMarkersAboveOthers = _orderClusterMarkersAboveOthers;
@synthesize clusterMarkerSize = _clusterMarkerSize, clusterAreaSize = _clusterAreaSize;
... ... @@ -224,8 +224,8 @@
minZoomLevel:(float)initialTileSourceMinZoomLevel
backgroundImage:(UIImage *)backgroundImage
{
_constrainMovement = _enableBouncing = _zoomingInPivotsAroundCenter = NO;
_enableDragging = YES;
_constrainMovement = _bouncingEnabled = _zoomingInPivotsAroundCenter = NO;
_draggingEnabled = YES;
_lastDraggingTranslation = CGPointZero;
_draggedAnnotation = nil;
... ... @@ -252,7 +252,7 @@
_annotations = [NSMutableSet new];
_visibleAnnotations = [NSMutableSet new];
[self setQuadTree:[[[RMQuadTree alloc] initWithMapView:self] autorelease]];
_enableClustering = _positionClusterMarkersAtTheGravityCenter = NO;
_clusteringEnabled = _positionClusterMarkersAtTheGravityCenter = NO;
_clusterMarkerSize = CGSizeMake(100.0, 100.0);
_clusterAreaSize = CGSizeMake(150.0, 150.0);
... ... @@ -1178,9 +1178,9 @@
_mapScrollView.showsVerticalScrollIndicator = NO;
_mapScrollView.showsHorizontalScrollIndicator = NO;
_mapScrollView.scrollsToTop = NO;
_mapScrollView.scrollEnabled = _enableDragging;
_mapScrollView.bounces = _enableBouncing;
_mapScrollView.bouncesZoom = _enableBouncing;
_mapScrollView.scrollEnabled = _draggingEnabled;
_mapScrollView.bounces = _bouncingEnabled;
_mapScrollView.bouncesZoom = _bouncingEnabled;
_mapScrollView.contentSize = contentSize;
_mapScrollView.minimumZoomScale = exp2f([self minZoom]);
_mapScrollView.maximumZoomScale = exp2f([self maxZoom]);
... ... @@ -1662,7 +1662,7 @@
if ([hit isEqual:_overlayView.layer])
return NO;
if (!hit || ([hit respondsToSelector:@selector(enableDragging)] && ![(RMMarker *)hit enableDragging]))
if (!hit || ([hit respondsToSelector:@selector(draggingEnabled)] && ![(RMMarker *)hit draggingEnabled]))
return NO;
if ( ! [self shouldDragAnnotation:[self findAnnotationInLayer:hit]])
... ... @@ -1689,7 +1689,7 @@
if ( ! hit)
return;
if ([hit respondsToSelector:@selector(enableDragging)] && ![(RMMarker *)hit enableDragging])
if ([hit respondsToSelector:@selector(draggingEnabled)] && ![(RMMarker *)hit draggingEnabled])
return;
_lastDraggingTranslation = CGPointZero;
... ... @@ -2352,9 +2352,9 @@
[self setZoom:tileSourcesZoom];
}
- (void)setEnableClustering:(BOOL)doEnableClustering
- (void)setClusteringEnabled:(BOOL)doEnableClustering
{
_enableClustering = doEnableClustering;
_clusteringEnabled = doEnableClustering;
[self correctPositionOfAllAnnotations];
}
... ... @@ -2373,25 +2373,25 @@
[_mapScrollView setDecelerationRate:decelerationRate];
}
- (BOOL)enableDragging
- (BOOL)draggingEnabled
{
return _enableDragging;
return _draggingEnabled;
}
- (void)setEnableDragging:(BOOL)enableDragging
- (void)setDraggingEnabled:(BOOL)enableDragging
{
_enableDragging = enableDragging;
_draggingEnabled = enableDragging;
_mapScrollView.scrollEnabled = enableDragging;
}
- (BOOL)enableBouncing
- (BOOL)bouncingEnabled
{
return _enableBouncing;
return _bouncingEnabled;
}
- (void)setEnableBouncing:(BOOL)enableBouncing
- (void)setBouncingEnabled:(BOOL)enableBouncing
{
_enableBouncing = enableBouncing;
_bouncingEnabled = enableBouncing;
_mapScrollView.bounces = enableBouncing;
_mapScrollView.bouncesZoom = enableBouncing;
}
... ... @@ -2701,7 +2701,7 @@
boundingBox.size.height += (2.0 * boundingBoxBuffer);
NSArray *annotationsToCorrect = [self.quadTree annotationsInProjectedRect:boundingBox
createClusterAnnotations:self.enableClustering
createClusterAnnotations:self.clusteringEnabled
withProjectedClusterSize:RMProjectedSizeMake(self.clusterAreaSize.width * _metersPerPixel, self.clusterAreaSize.height * _metersPerPixel)
andProjectedClusterMarkerSize:RMProjectedSizeMake(self.clusterMarkerSize.width * _metersPerPixel, self.clusterMarkerSize.height * _metersPerPixel)
findGravityCenter:self.positionClusterMarkersAtTheGravityCenter];
... ... @@ -2895,7 +2895,7 @@
[self.quadTree addAnnotation:annotation];
}
if (_enableClustering)
if (_clusteringEnabled)
{
[self correctPositionOfAllAnnotations];
}
... ...