1. Download our Official Android App: Forums for Android!

Apps Drawing lots of lines on a Map Overlay

Discussion in 'Android Development' started by jeffdbrown, Feb 13, 2011.

  1. jeffdbrown

    jeffdbrown Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Feb 13, 2011

    Feb 13, 2011
    1
    0
    5
    I am working on an application which I need to plot out the route of a bus on a mapview. The problem is that there are many GPS lines to plot to draw the route and draw is called so often that it makes moving the map incredibly slow.

    I have tried a few different methods but none have produced good results yet:
    * Only drawing the points every 5th call of "Draw"
    * Drawing on a bitmap in a canvas and then copying the canvas over when draw is called
    * Doing the same as above but only updating the canvas when zoom has changed or the map has been moved more than 100 pixels
    * Drawing lines that are only within view of the current map position (this is difficult because a map could need to see the line, but the endpoints of that line might be outside the view of the map)

    I have looked at ItemizedOverlay a bit and it doesn't look like it would remedy the situation, but maybe I am wrong. Any suggestions that might help would be greatly appreciated!

    Thanks,
    Jeff
     

    Advertisement

Share This Page

Loading...