lishxi / osmdroid

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

Do Overlay.onDraw the same as Google Maps Overlay #164

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently Overlay has two methods
onDraw - this is called first
onDrawFinished - this is called last
Both methods are called sequentially for each overlay.

Google Maps overlay has on method onDraw with a parameter "shadow". It calls 
all overlays with shadow = true first, then all overlays with shadow = false 
afterwards.

I am submitting this issue to suggest that we change osmdroid to work the same 
way as Google.

I've attached a patch which seems to work.

This issue is derived from some comments on issue 155.

Original issue reported on code.google.com by neilboyd on 22 Feb 2011 at 3:42

Attachments:

GoogleCodeExporter commented 9 years ago
Actually I just noticed that Google has draw, not onDraw, so I should change it 
to that.

http://code.google.com/android/add-ons/google-apis/reference/com/google/android/
maps/Overlay.html

Original comment by neilboyd on 23 Feb 2011 at 10:41

GoogleCodeExporter commented 9 years ago
Neil - this looks good, but it loses the "enabled" setting functionality for 
individual overlays. The reason we called onManagedDraw is so that we could 
short-circuit calling onDraw if !mEnabled. However, this functionality can 
easily be handled by the OverlayManager, and I'll note in the comments that the 
"enabled" functionality must be checked externally before calling onDraw.

Original comment by kurtzm...@gmail.com on 26 Feb 2011 at 10:08

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r827.

Applied Neil's patch, changed onDraw to draw, and added isEnabled() checks

Original comment by kurtzm...@gmail.com on 26 Feb 2011 at 10:18

GoogleCodeExporter commented 9 years ago

Original comment by neilboyd on 4 Mar 2011 at 2:59