On Mon, Feb 15, 2010 at 11:35 AM, Stefan <[email protected]> wrote: > So how can i detect, if the map has a new Map center for > example? >
You could save the map center location and check in the draw method to see if it's changed since the last time. There's probably a better way, but there's one idea. > Another solution could be, that i transmit the gps points to my > overlay class, check whether the point is visible and draw the line > (because every time the map position chages, the draw method will be > called)? > That should work. In the thread mentioned above i read, that it is more > efficient to draw the lines into a bitmap and than draw the bitmap > instead of use the canvas.drawLine function. > I don't know about that, maybe yes, maybe no. I find it hard to believe drawing lines to a bitmap and then drawing the bitmap would be much faster than just drawing the lines directly, but hey, I'm no expert. Try both ways and see which works best. > Means that, that i use > ONE bitmap for all lines or must i create a bitmap for each line? > Try both. I imagine making a bitmap for each line will probably be slower then the former option. > I dont find a nice tutorial for that and i have a mental block now... > how would the code looks like? > Sorry, I don't know about drawing to a bitmap, but the Canvas should have a function to draw a Bitmap once you have one ready to draw. or can i add all gps points (no check, if gps point is visible) into > the bitmap and the perfomance is still fast?? > Don't know. Try it and see for yourself. ------------------------------------------------------------------------------------------------- TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

