KapoorVashisht / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

Circle size not consistent with ScaleBarOverlay #293

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Import the attached demo project into Eclipse, launch. Enter half of what 
the scale bar shows.

What is the expected output? What do you see instead?
The resulting circle's diameter should match the length of the scale bar. 
Instead, the circle is much smaller.

What version of the product are you using? On what operating system?
I'm using a patched version of osmdroid (jar included), the patch's only change 
being changing a method of ScaleBarOverlay from private to protected to show 
the actual length in meters.

Original issue reported on code.google.com by christia...@gmail.com on 7 Jan 2012 at 10:40

Attachments:

GoogleCodeExporter commented 8 years ago
I had a look and I think the code to draw the circle is wrong. The scale bar 
seems to be correct. I realise you copied that code from MyLocationOverlay, 
which means that code is wrong. I think MyLocationOverlay uses the distance at 
the equator, whereas ScaleBarOverlay uses the distance at your location. 
Perhaps you'd like to submit a patch for MyLocationOverlay :-)

Original comment by neilboyd on 7 Jan 2012 at 9:48

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Actually I've done it myself ;-)

In your code, change calculation of actualRadius :
float actualRadius = radius / (float) 
TileSystem.GroundResolution(location.getLatitude(), mapView.getZoomLevel());

Original comment by neilboyd on 7 Jan 2012 at 10:02

Attachments:

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r1033.

Original comment by neilboyd on 12 Jan 2012 at 8:09