Issue
I'm trying to draw a route onto my MapView. I've extended Overlay and implemented the draw() method. The route is displayed properly, although while debugging, I added a breakpoint on draw(), and noticed it is being called constantly.
I only want it to be re-drawn if someone moves the map or zooms (the draw take into account these changes when drawing the route) What can cause this ?
Solution
There are two draw methods that can be overridden.
void draw(android.graphics.Canvas canvas, MapView mapView, boolean shadow)
Desc: Draw the overlay over the map.
boolean draw(android.graphics.Canvas canvas, MapView mapView, boolean shadow, long when)
Desc: Draw call for animated overlays.
I originally overrided the second one.
After changing to the first method, it worked out.
Answered By - Itsik
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.