draw is being constantly called in my android map overlay

后端 未结 8 1801
走了就别回头了
走了就别回头了 2021-01-04 09:30

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 b

8条回答
  •  悲哀的现实
    2021-01-04 09:48

    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.

提交回复
热议问题