There are several reasons why a drawable is no longer used in the
rewrite branch. First, Drawable is a very specific Android class which
makes it impossible to write Layers that can be integrated in the
AWT/Swing based map application as well.
Second, in order for a drawable to appear correctly, its bounds had to
be set correctly. We had many bug reports and discussions where people
failed to do that correctly. During the actual drawing the bounds of the
Drawable had to be modified and restored afterwards. There is no way to
do that in a thread safe way as everybody with a reference to the
drawable can modify the bounds at the same time. Besides that, getting
and setting the bounds twice at each redraw iteration simply sucks and
degrades the performance. But mainly the fact that a drawable is neither
immutable nor thread safe disqualifies it for this purpose. The Drawable
was only used because we tried to mimic Google's API.
I think the current API is easier to understand and still flexible. A
bitmap should be a well known concept for any (Android) developer.
Passing two integer offsets to modify the alignment is also straight
forward and allows for arbitrary positioning relative to the LatLon.
Greetings,
Thilo
> --
> You received this message because you are subscribed to the Google
> Groups "mapsforge-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
mapsforge-de...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>