|
@@ -163,7 +163,7 @@ |
|
@@ -163,7 +163,7 @@ |
163
|
CGSize _lastContentSize;
|
163
|
CGSize _lastContentSize;
|
164
|
BOOL _mapScrollViewIsZooming;
|
164
|
BOOL _mapScrollViewIsZooming;
|
165
|
|
165
|
|
166
|
- BOOL _enableDragging, _enableBouncing;
|
166
|
+ BOOL _draggingEnabled, _bouncingEnabled;
|
167
|
|
167
|
|
168
|
CGPoint _lastDraggingTranslation;
|
168
|
CGPoint _lastDraggingTranslation;
|
169
|
RMAnnotation *_draggedAnnotation;
|
169
|
RMAnnotation *_draggedAnnotation;
|
|
@@ -200,7 +200,7 @@ |
|
@@ -200,7 +200,7 @@ |
200
|
@synthesize screenScale = _screenScale;
|
200
|
@synthesize screenScale = _screenScale;
|
201
|
@synthesize tileCache = _tileCache;
|
201
|
@synthesize tileCache = _tileCache;
|
202
|
@synthesize quadTree = _quadTree;
|
202
|
@synthesize quadTree = _quadTree;
|
203
|
-@synthesize enableClustering = _enableClustering;
|
203
|
+@synthesize clusteringEnabled = _clusteringEnabled;
|
204
|
@synthesize positionClusterMarkersAtTheGravityCenter = _positionClusterMarkersAtTheGravityCenter;
|
204
|
@synthesize positionClusterMarkersAtTheGravityCenter = _positionClusterMarkersAtTheGravityCenter;
|
205
|
@synthesize orderClusterMarkersAboveOthers = _orderClusterMarkersAboveOthers;
|
205
|
@synthesize orderClusterMarkersAboveOthers = _orderClusterMarkersAboveOthers;
|
206
|
@synthesize clusterMarkerSize = _clusterMarkerSize, clusterAreaSize = _clusterAreaSize;
|
206
|
@synthesize clusterMarkerSize = _clusterMarkerSize, clusterAreaSize = _clusterAreaSize;
|
|
@@ -224,8 +224,8 @@ |
|
@@ -224,8 +224,8 @@ |
224
|
minZoomLevel:(float)initialTileSourceMinZoomLevel
|
224
|
minZoomLevel:(float)initialTileSourceMinZoomLevel
|
225
|
backgroundImage:(UIImage *)backgroundImage
|
225
|
backgroundImage:(UIImage *)backgroundImage
|
226
|
{
|
226
|
{
|
227
|
- _constrainMovement = _enableBouncing = _zoomingInPivotsAroundCenter = NO;
|
|
|
228
|
- _enableDragging = YES;
|
227
|
+ _constrainMovement = _bouncingEnabled = _zoomingInPivotsAroundCenter = NO;
|
|
|
228
|
+ _draggingEnabled = YES;
|
229
|
|
229
|
|
230
|
_lastDraggingTranslation = CGPointZero;
|
230
|
_lastDraggingTranslation = CGPointZero;
|
231
|
_draggedAnnotation = nil;
|
231
|
_draggedAnnotation = nil;
|
|
@@ -252,7 +252,7 @@ |
|
@@ -252,7 +252,7 @@ |
252
|
_annotations = [NSMutableSet new];
|
252
|
_annotations = [NSMutableSet new];
|
253
|
_visibleAnnotations = [NSMutableSet new];
|
253
|
_visibleAnnotations = [NSMutableSet new];
|
254
|
[self setQuadTree:[[[RMQuadTree alloc] initWithMapView:self] autorelease]];
|
254
|
[self setQuadTree:[[[RMQuadTree alloc] initWithMapView:self] autorelease]];
|
255
|
- _enableClustering = _positionClusterMarkersAtTheGravityCenter = NO;
|
255
|
+ _clusteringEnabled = _positionClusterMarkersAtTheGravityCenter = NO;
|
256
|
_clusterMarkerSize = CGSizeMake(100.0, 100.0);
|
256
|
_clusterMarkerSize = CGSizeMake(100.0, 100.0);
|
257
|
_clusterAreaSize = CGSizeMake(150.0, 150.0);
|
257
|
_clusterAreaSize = CGSizeMake(150.0, 150.0);
|
258
|
|
258
|
|
|
@@ -1178,9 +1178,9 @@ |
|
@@ -1178,9 +1178,9 @@ |
1178
|
_mapScrollView.showsVerticalScrollIndicator = NO;
|
1178
|
_mapScrollView.showsVerticalScrollIndicator = NO;
|
1179
|
_mapScrollView.showsHorizontalScrollIndicator = NO;
|
1179
|
_mapScrollView.showsHorizontalScrollIndicator = NO;
|
1180
|
_mapScrollView.scrollsToTop = NO;
|
1180
|
_mapScrollView.scrollsToTop = NO;
|
1181
|
- _mapScrollView.scrollEnabled = _enableDragging;
|
|
|
1182
|
- _mapScrollView.bounces = _enableBouncing;
|
|
|
1183
|
- _mapScrollView.bouncesZoom = _enableBouncing;
|
1181
|
+ _mapScrollView.scrollEnabled = _draggingEnabled;
|
|
|
1182
|
+ _mapScrollView.bounces = _bouncingEnabled;
|
|
|
1183
|
+ _mapScrollView.bouncesZoom = _bouncingEnabled;
|
1184
|
_mapScrollView.contentSize = contentSize;
|
1184
|
_mapScrollView.contentSize = contentSize;
|
1185
|
_mapScrollView.minimumZoomScale = exp2f([self minZoom]);
|
1185
|
_mapScrollView.minimumZoomScale = exp2f([self minZoom]);
|
1186
|
_mapScrollView.maximumZoomScale = exp2f([self maxZoom]);
|
1186
|
_mapScrollView.maximumZoomScale = exp2f([self maxZoom]);
|
|
@@ -1662,7 +1662,7 @@ |
|
@@ -1662,7 +1662,7 @@ |
1662
|
if ([hit isEqual:_overlayView.layer])
|
1662
|
if ([hit isEqual:_overlayView.layer])
|
1663
|
return NO;
|
1663
|
return NO;
|
1664
|
|
1664
|
|
1665
|
- if (!hit || ([hit respondsToSelector:@selector(enableDragging)] && ![(RMMarker *)hit enableDragging]))
|
1665
|
+ if (!hit || ([hit respondsToSelector:@selector(draggingEnabled)] && ![(RMMarker *)hit draggingEnabled]))
|
1666
|
return NO;
|
1666
|
return NO;
|
1667
|
|
1667
|
|
1668
|
if ( ! [self shouldDragAnnotation:[self findAnnotationInLayer:hit]])
|
1668
|
if ( ! [self shouldDragAnnotation:[self findAnnotationInLayer:hit]])
|
|
@@ -1689,7 +1689,7 @@ |
|
@@ -1689,7 +1689,7 @@ |
1689
|
if ( ! hit)
|
1689
|
if ( ! hit)
|
1690
|
return;
|
1690
|
return;
|
1691
|
|
1691
|
|
1692
|
- if ([hit respondsToSelector:@selector(enableDragging)] && ![(RMMarker *)hit enableDragging])
|
1692
|
+ if ([hit respondsToSelector:@selector(draggingEnabled)] && ![(RMMarker *)hit draggingEnabled])
|
1693
|
return;
|
1693
|
return;
|
1694
|
|
1694
|
|
1695
|
_lastDraggingTranslation = CGPointZero;
|
1695
|
_lastDraggingTranslation = CGPointZero;
|
|
@@ -2352,9 +2352,9 @@ |
|
@@ -2352,9 +2352,9 @@ |
2352
|
[self setZoom:tileSourcesZoom];
|
2352
|
[self setZoom:tileSourcesZoom];
|
2353
|
}
|
2353
|
}
|
2354
|
|
2354
|
|
2355
|
-- (void)setEnableClustering:(BOOL)doEnableClustering
|
2355
|
+- (void)setClusteringEnabled:(BOOL)doEnableClustering
|
2356
|
{
|
2356
|
{
|
2357
|
- _enableClustering = doEnableClustering;
|
2357
|
+ _clusteringEnabled = doEnableClustering;
|
2358
|
|
2358
|
|
2359
|
[self correctPositionOfAllAnnotations];
|
2359
|
[self correctPositionOfAllAnnotations];
|
2360
|
}
|
2360
|
}
|
|
@@ -2373,25 +2373,25 @@ |
|
@@ -2373,25 +2373,25 @@ |
2373
|
[_mapScrollView setDecelerationRate:decelerationRate];
|
2373
|
[_mapScrollView setDecelerationRate:decelerationRate];
|
2374
|
}
|
2374
|
}
|
2375
|
|
2375
|
|
2376
|
-- (BOOL)enableDragging
|
2376
|
+- (BOOL)draggingEnabled
|
2377
|
{
|
2377
|
{
|
2378
|
- return _enableDragging;
|
2378
|
+ return _draggingEnabled;
|
2379
|
}
|
2379
|
}
|
2380
|
|
2380
|
|
2381
|
-- (void)setEnableDragging:(BOOL)enableDragging
|
2381
|
+- (void)setDraggingEnabled:(BOOL)enableDragging
|
2382
|
{
|
2382
|
{
|
2383
|
- _enableDragging = enableDragging;
|
2383
|
+ _draggingEnabled = enableDragging;
|
2384
|
_mapScrollView.scrollEnabled = enableDragging;
|
2384
|
_mapScrollView.scrollEnabled = enableDragging;
|
2385
|
}
|
2385
|
}
|
2386
|
|
2386
|
|
2387
|
-- (BOOL)enableBouncing
|
2387
|
+- (BOOL)bouncingEnabled
|
2388
|
{
|
2388
|
{
|
2389
|
- return _enableBouncing;
|
2389
|
+ return _bouncingEnabled;
|
2390
|
}
|
2390
|
}
|
2391
|
|
2391
|
|
2392
|
-- (void)setEnableBouncing:(BOOL)enableBouncing
|
2392
|
+- (void)setBouncingEnabled:(BOOL)enableBouncing
|
2393
|
{
|
2393
|
{
|
2394
|
- _enableBouncing = enableBouncing;
|
2394
|
+ _bouncingEnabled = enableBouncing;
|
2395
|
_mapScrollView.bounces = enableBouncing;
|
2395
|
_mapScrollView.bounces = enableBouncing;
|
2396
|
_mapScrollView.bouncesZoom = enableBouncing;
|
2396
|
_mapScrollView.bouncesZoom = enableBouncing;
|
2397
|
}
|
2397
|
}
|
|
@@ -2701,7 +2701,7 @@ |
|
@@ -2701,7 +2701,7 @@ |
2701
|
boundingBox.size.height += (2.0 * boundingBoxBuffer);
|
2701
|
boundingBox.size.height += (2.0 * boundingBoxBuffer);
|
2702
|
|
2702
|
|
2703
|
NSArray *annotationsToCorrect = [self.quadTree annotationsInProjectedRect:boundingBox
|
2703
|
NSArray *annotationsToCorrect = [self.quadTree annotationsInProjectedRect:boundingBox
|
2704
|
- createClusterAnnotations:self.enableClustering
|
2704
|
+ createClusterAnnotations:self.clusteringEnabled
|
2705
|
withProjectedClusterSize:RMProjectedSizeMake(self.clusterAreaSize.width * _metersPerPixel, self.clusterAreaSize.height * _metersPerPixel)
|
2705
|
withProjectedClusterSize:RMProjectedSizeMake(self.clusterAreaSize.width * _metersPerPixel, self.clusterAreaSize.height * _metersPerPixel)
|
2706
|
andProjectedClusterMarkerSize:RMProjectedSizeMake(self.clusterMarkerSize.width * _metersPerPixel, self.clusterMarkerSize.height * _metersPerPixel)
|
2706
|
andProjectedClusterMarkerSize:RMProjectedSizeMake(self.clusterMarkerSize.width * _metersPerPixel, self.clusterMarkerSize.height * _metersPerPixel)
|
2707
|
findGravityCenter:self.positionClusterMarkersAtTheGravityCenter];
|
2707
|
findGravityCenter:self.positionClusterMarkersAtTheGravityCenter];
|
|
@@ -2895,7 +2895,7 @@ |
|
@@ -2895,7 +2895,7 @@ |
2895
|
[self.quadTree addAnnotation:annotation];
|
2895
|
[self.quadTree addAnnotation:annotation];
|
2896
|
}
|
2896
|
}
|
2897
|
|
2897
|
|
2898
|
- if (_enableClustering)
|
2898
|
+ if (_clusteringEnabled)
|
2899
|
{
|
2899
|
{
|
2900
|
[self correctPositionOfAllAnnotations];
|
2900
|
[self correctPositionOfAllAnnotations];
|
2901
|
}
|
2901
|
}
|