MapXL / route-me

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

marker fractional positions causing blurry images #64

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
You can put any layer on any position, decimal or fractional. When you put
something fractional the phone will try to do what it can. 

For RMLayer subclasses this is probably a bad idea for the most part. 

The suggested fix is as follows:

- (void)setPosition:(CGPoint)position;
{
    position.x = floor(position.x+0.5);
    position.y = floor(position.y+0.5);
    [super setPosition:position];
}

Putting this into RMMarker will mean that when a position comes back from
the projection and is translated into fractional screen units, the marker
will round to the best screen coordinate and then use that to set its own
position. The result is that you don't get random blurry markers.

Original issue reported on code.google.com by dbx.gt...@gmail.com on 3 Mar 2009 at 11:59

GoogleCodeExporter commented 8 years ago
OK, do *not* use this suggested code haha... it fixes the issue about the images
being blurry but there is a side effect elsewhere in the kit, where the 
positions
might being used to calculate backwards... or so I think. Seems to cause marker
skating over the map during zoom, and inaccuracies. But the markers do become 
crisp!

Original comment by dbx.gt...@gmail.com on 4 Mar 2009 at 1:41

GoogleCodeExporter commented 8 years ago
The issue is that the markers HAVE to be at fractional positions in order to 
remain
where they are.

Original comment by Quazie on 4 Mar 2009 at 2:03

GoogleCodeExporter commented 8 years ago
All that's needed is some dynamic filtering of the position during scaling. I 
think
this should be something to resolve one day, but not high priority. 

Sub-pixel accuracy is not something any other platform has had to require, and 
the
results are *much* better when filtering and placing on pixel boundaries. 

Original comment by tybe...@gmail.com on 4 Mar 2009 at 5:04

GoogleCodeExporter commented 8 years ago
No, that's not the issue really. Pixel alignment of the image should be 
independent of the latlon position. I'll 
investigate.

My code will go in the issue59 branch.

Original comment by john.e...@gmail.com on 4 Mar 2009 at 5:25

GoogleCodeExporter commented 8 years ago

Original comment by john.e...@gmail.com on 6 Mar 2009 at 9:34