Add latLongToTilePoint to convert lat/lon to RMTile
Add [overlay correctPositionOfAllSublayers] to setZoom/setScale to fix issue w/ wandering markers
Showing
2 changed files
with
8 additions
and
0 deletions
@@ -181,6 +181,7 @@ enum { | @@ -181,6 +181,7 @@ enum { | ||
181 | 181 | ||
182 | - (CGPoint)latLongToPixel:(CLLocationCoordinate2D)latlong; | 182 | - (CGPoint)latLongToPixel:(CLLocationCoordinate2D)latlong; |
183 | - (CGPoint)latLongToPixel:(CLLocationCoordinate2D)latlong withScale:(float)aScale; | 183 | - (CGPoint)latLongToPixel:(CLLocationCoordinate2D)latlong withScale:(float)aScale; |
184 | +- (RMTilePoint)latLongToTilePoint:(CLLocationCoordinate2D)latlong withScale:(float)aScale; | ||
184 | - (CLLocationCoordinate2D)pixelToLatLong:(CGPoint)aPixel; | 185 | - (CLLocationCoordinate2D)pixelToLatLong:(CGPoint)aPixel; |
185 | - (CLLocationCoordinate2D)pixelToLatLong:(CGPoint)aPixel withScale:(float)aScale; | 186 | - (CLLocationCoordinate2D)pixelToLatLong:(CGPoint)aPixel withScale:(float)aScale; |
186 | 187 |
@@ -296,6 +296,7 @@ | @@ -296,6 +296,7 @@ | ||
296 | [imagesOnScreen moveBy:delta]; | 296 | [imagesOnScreen moveBy:delta]; |
297 | [tileLoader moveBy:delta]; | 297 | [tileLoader moveBy:delta]; |
298 | [overlay moveBy:delta]; | 298 | [overlay moveBy:delta]; |
299 | + [overlay correctPositionOfAllSublayers]; | ||
299 | [renderer setNeedsDisplay]; | 300 | [renderer setNeedsDisplay]; |
300 | } | 301 | } |
301 | 302 | ||
@@ -749,6 +750,7 @@ | @@ -749,6 +750,7 @@ | ||
749 | calculateScaleFromZoom:zoom]; | 750 | calculateScaleFromZoom:zoom]; |
750 | //RMLog(@"new scale: %f, scale"); | 751 | //RMLog(@"new scale: %f, scale"); |
751 | [self setScale:scale]; | 752 | [self setScale:scale]; |
753 | + [overlay correctPositionOfAllSublayers]; | ||
752 | 754 | ||
753 | } | 755 | } |
754 | 756 | ||
@@ -810,6 +812,11 @@ static BOOL _performExpensiveOperations = YES; | @@ -810,6 +812,11 @@ static BOOL _performExpensiveOperations = YES; | ||
810 | return [mercatorToScreenProjection projectXYPoint:[projection latLongToPoint:latlong] withScale:aScale]; | 812 | return [mercatorToScreenProjection projectXYPoint:[projection latLongToPoint:latlong] withScale:aScale]; |
811 | } | 813 | } |
812 | 814 | ||
815 | +- (RMTilePoint)latLongToTilePoint:(CLLocationCoordinate2D)latlong withScale:(float)aScale | ||
816 | +{ | ||
817 | + return [mercatorToTileProjection project:[projection latLongToPoint:latlong] atZoom:aScale]; | ||
818 | +} | ||
819 | + | ||
813 | - (CLLocationCoordinate2D)pixelToLatLong:(CGPoint)aPixel | 820 | - (CLLocationCoordinate2D)pixelToLatLong:(CGPoint)aPixel |
814 | { | 821 | { |
815 | return [projection pointToLatLong:[mercatorToScreenProjection projectScreenPointToXY:aPixel]]; | 822 | return [projection pointToLatLong:[mercatorToScreenProjection projectScreenPointToXY:aPixel]]; |
-
Please register or login to post a comment