hungio / route-me

Automatically exported from code.google.com/p/route-me
0 stars 0 forks source link

Map Center and Markers are off centered when Initialized with CGRectZero #40

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a RMMapView with frame set to CGRectZero and a valid coordinate
2. Set it to the view of a view 
3. Add a RMMarker to the map

What is the expected output? What do you see instead?
Marker and center show up in the correct location
Marker and center show up to the left where the center used to be at 0,0

What version of the product are you using? On what operating system?
Revision 192
iPhone OS 2.2 \ (Build Device - 2.0 | Debug)

Please provide any additional information below.
I added the following two lines of code to fix this to the setFrame method in 
RMMapView

- (void)setFrame:(CGRect)frame
{
    CLLocationCoordinate2D center = self.mapCenter; //NEW
  CGRect bounds = CGRectMake(0, 0, frame.size.width, frame.size.height);
  [mercatorToScreenProjection setScreenBounds:bounds];
  background.frame = bounds;
  layer.frame = frame;
  overlay.frame = bounds;
  [tileLoader clearLoadedBounds];
  [tileLoader updateLoadedImages];
  [renderer setFrame:frame];
    [self moveToLatLong:center]; //NEW
}

Original issue reported on code.google.com by josephhu...@gmail.com on 6 Feb 2009 at 9:25

GoogleCodeExporter commented 8 years ago
typo

2. Set it to the view of a UIViewController

Original comment by josephhu...@gmail.com on 6 Feb 2009 at 9:28

GoogleCodeExporter commented 8 years ago

Original comment by halmuel...@gmail.com on 4 Mar 2009 at 6:07

GoogleCodeExporter commented 8 years ago
Multiple issues may be resolved by r231. Please do a checkout of 
/svn/branches/issue63 and test 
against that branch.

Original comment by halmuel...@gmail.com on 4 Mar 2009 at 9:41

GoogleCodeExporter commented 8 years ago
Closing based on r231.

Original comment by halmuel...@gmail.com on 8 Mar 2009 at 6:51