Hello Guys,

anyone knows how to implement an overlay on googles mapview very fast
and performant just like in the application mytracks? Especially when
many points have to be drawn on the overly.  In the mytracks app, it
is alwas very fast independent how much points are drawn...

Here is the code snippet how I do it, but it is, like I said, not very
fast when drawing many points on the Overlay.
Here is the way I do do it:
Every time the user changes the mapView the "draw"-method of the
ItemizedOverlay class is called and the Projection.toPixels method
must be called for each point to draw on the map to get the right x/y
coordinates. Code looks like this(this is the fastest method i know
all others that i have tried are slower):
 "Projection projection = mapView.getProjection();
  for (int i =0; i < geoPoints.size(); i++ ) {
    . ..
    projection.toPixels(geoPoints.get(i), point);
    ...
    path.moveTo(point.x, point.y);
     ...
     path.lineTo(point.x, point.y);"
  }
  canvas.drawPath(path, paint);
  "
When I compare the performance of the overlay of myTracks and the
overlay of my program, I wonder how they achieved a much better
performance than me. I have googled very long to find a solution to my
problem, but I have not found any code examples, which show how to
make it better. The Android Api Demos doesen't include an example that
is useful, or I missed it?  Thats why I post the problem here, and i
hope someone knows the answer and could send me an code example to do
it better

Thanks and best Regards!
Stefan from Germany

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to