|
@@ -52,9 +52,9 @@ |
|
@@ -52,9 +52,9 @@ |
52
|
|
52
|
|
53
|
#pragma mark --- begin constants ----
|
53
|
#pragma mark --- begin constants ----
|
54
|
|
54
|
|
55
|
-#define kDefaultDecelerationFactor .88f
|
55
|
+#define kDefaultDecelerationFactor .80f
|
56
|
#define kMinDecelerationDelta 0.6f
|
56
|
#define kMinDecelerationDelta 0.6f
|
57
|
-#define kDecelerationTimerInterval 0.02f
|
57
|
+#define kDecelerationTimerInterval 0.04f
|
58
|
|
58
|
|
59
|
#define kZoomAnimationStepTime 0.03f
|
59
|
#define kZoomAnimationStepTime 0.03f
|
60
|
#define kZoomAnimationAnimationTime 0.1f
|
60
|
#define kZoomAnimationAnimationTime 0.1f
|
|
@@ -420,10 +420,10 @@ |
|
@@ -420,10 +420,10 @@ |
420
|
if (![self tileSourceBoundsContainProjectedPoint:projectedCenter])
|
420
|
if (![self tileSourceBoundsContainProjectedPoint:projectedCenter])
|
421
|
return;
|
421
|
return;
|
422
|
|
422
|
|
423
|
- [mercatorToScreenProjection moveScreenBy:delta];
|
|
|
424
|
- [imagesOnScreen moveBy:delta];
|
|
|
425
|
- [tileLoader moveBy:delta];
|
|
|
426
|
- [self correctPositionOfAllAnnotationsIncludingInvisibles:correctAllSublayers];
|
423
|
+ [mercatorToScreenProjection moveScreenBy:delta];
|
|
|
424
|
+ [imagesOnScreen moveBy:delta];
|
|
|
425
|
+ [tileLoader moveBy:delta];
|
|
|
426
|
+ [self correctPositionOfAllAnnotationsIncludingInvisibles:correctAllSublayers];
|
427
|
}
|
427
|
}
|
428
|
|
428
|
|
429
|
- (void)moveToCoordinate:(CLLocationCoordinate2D)coordinate animated:(BOOL)animated
|
429
|
- (void)moveToCoordinate:(CLLocationCoordinate2D)coordinate animated:(BOOL)animated
|
|
@@ -1088,9 +1088,8 @@ |
|
@@ -1088,9 +1088,8 @@ |
1088
|
return;
|
1088
|
return;
|
1089
|
|
1089
|
|
1090
|
[mercatorToScreenProjection setProjectedCenter:projectedPoint];
|
1090
|
[mercatorToScreenProjection setProjectedCenter:projectedPoint];
|
1091
|
- [self correctPositionOfAllAnnotations];
|
|
|
1092
|
[tileLoader reload];
|
1091
|
[tileLoader reload];
|
1093
|
- [overlay setNeedsDisplay];
|
1092
|
+ [self correctPositionOfAllAnnotations];
|
1094
|
}
|
1093
|
}
|
1095
|
|
1094
|
|
1096
|
- (RMProjectedRect)projectedBounds
|
1095
|
- (RMProjectedRect)projectedBounds
|
|
@@ -1101,6 +1100,8 @@ |
|
@@ -1101,6 +1100,8 @@ |
1101
|
- (void)setProjectedBounds:(RMProjectedRect)boundsRect
|
1100
|
- (void)setProjectedBounds:(RMProjectedRect)boundsRect
|
1102
|
{
|
1101
|
{
|
1103
|
[mercatorToScreenProjection setProjectedBounds:boundsRect];
|
1102
|
[mercatorToScreenProjection setProjectedBounds:boundsRect];
|
|
|
1103
|
+ [tileLoader reload];
|
|
|
1104
|
+ [self correctPositionOfAllAnnotations];
|
1104
|
}
|
1105
|
}
|
1105
|
|
1106
|
|
1106
|
- (RMTileRect)tileBounds
|
1107
|
- (RMTileRect)tileBounds
|
|
@@ -1308,6 +1309,10 @@ |
|
@@ -1308,6 +1309,10 @@ |
1308
|
CGRect screenBounds = [[self mercatorToScreenProjection] screenBounds];
|
1309
|
CGRect screenBounds = [[self mercatorToScreenProjection] screenBounds];
|
1309
|
CALayer *lastLayer = nil;
|
1310
|
CALayer *lastLayer = nil;
|
1310
|
|
1311
|
|
|
|
1312
|
+ // Prevent blurry movements
|
|
|
1313
|
+ [CATransaction begin];
|
|
|
1314
|
+ [CATransaction setAnimationDuration:0];
|
|
|
1315
|
+
|
1311
|
@synchronized (annotations)
|
1316
|
@synchronized (annotations)
|
1312
|
{
|
1317
|
{
|
1313
|
if (correctAllAnnotations)
|
1318
|
if (correctAllAnnotations)
|
|
@@ -1329,21 +1334,23 @@ |
|
@@ -1329,21 +1334,23 @@ |
1329
|
|
1334
|
|
1330
|
[visibleAnnotations addObject:annotation];
|
1335
|
[visibleAnnotations addObject:annotation];
|
1331
|
}
|
1336
|
}
|
|
|
1337
|
+ lastLayer = annotation.layer;
|
1332
|
} else {
|
1338
|
} else {
|
1333
|
annotation.layer = nil;
|
1339
|
annotation.layer = nil;
|
1334
|
[visibleAnnotations removeObject:annotation];
|
1340
|
[visibleAnnotations removeObject:annotation];
|
1335
|
}
|
1341
|
}
|
1336
|
- lastLayer = annotation.layer;
|
|
|
1337
|
}
|
1342
|
}
|
1338
|
- RMLog(@"%d annotations on screen, %d total", [[overlay sublayers] count], [annotations count]);
|
1343
|
+// RMLog(@"%d annotations on screen, %d total", [[overlay sublayers] count], [annotations count]);
|
1339
|
} else {
|
1344
|
} else {
|
1340
|
for (RMAnnotation *annotation in visibleAnnotations)
|
1345
|
for (RMAnnotation *annotation in visibleAnnotations)
|
1341
|
{
|
1346
|
{
|
1342
|
[self correctScreenPosition:annotation];
|
1347
|
[self correctScreenPosition:annotation];
|
1343
|
}
|
1348
|
}
|
1344
|
- RMLog(@"%d annotations corrected", [visibleAnnotations count]);
|
1349
|
+// RMLog(@"%d annotations corrected", [visibleAnnotations count]);
|
1345
|
}
|
1350
|
}
|
1346
|
}
|
1351
|
}
|
|
|
1352
|
+
|
|
|
1353
|
+ [CATransaction commit];
|
1347
|
}
|
1354
|
}
|
1348
|
|
1355
|
|
1349
|
- (void)correctPositionOfAllAnnotations
|
1356
|
- (void)correctPositionOfAllAnnotations
|