anasrp08 / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 3 forks source link

Loading tile instead of background color #154

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I see that the onDraw code has some code to draw a "loading" tile but it is 
deemed too slow. Instead of drawing the loading tile from scratch every time we 
draw, we can creating a Bitmap at TilesOverlay startup and draw the loading 
tile to the bitmap. When we can't return a tile from the tile provider, we 
provide the loading tile instead.

We would move the mBackgroundColor stuff to TilesOverlay and that would dictate 
what the background color of the loading tile is. We can also have a setting 
for the color of the lines.

I tried this out and it works nicely and there is no noticeable decrease in 
speed. The loading tiles look more like Google maps and we can actually tell 
that we are scrolling when there are no map tiles loaded to the screen yet.

Are we all in favor?

Original issue reported on code.google.com by kurtzm...@gmail.com on 4 Feb 2011 at 4:31

GoogleCodeExporter commented 9 years ago
Example patch included for anyone who wants to see what it looks like. Put the 
phone in offline mode and check it out.

Original comment by kurtzm...@gmail.com on 4 Feb 2011 at 4:57

Attachments:

GoogleCodeExporter commented 9 years ago
Looks good.

I think we need a way to access it via MapView, or more specifically IMapView.

A couple of days ago I added setBackgroundColor to IMapView. The reason was 
because I'd like a dark background at night. I'd also like to be able to do the 
same thing with this.

In fact, why not just put all this code into MapView instead of TilesOverlay?

Original comment by neilboyd on 4 Feb 2011 at 12:27

GoogleCodeExporter commented 9 years ago
I think the best place for it is in TilesOverlay - that is where we calculate 
tile-to-screen positions and really the only place where we know where the tile 
is supposed to be drawn (without recalculating everything over), and if there 
was no proper tile returned from the tile provider.

However, there is no reason we can't pass the setBackgroundColor call from the 
MapView to call the TilesOverlay. In issue 155 (the OverlayManager class), one 
of the things I wanted to do was give better access to the TilesOverlay since 
it is a special case, so that should facilitate setting the background color of 
the loading tile.

Original comment by kurtzm...@gmail.com on 4 Feb 2011 at 11:52

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r775.

Original comment by kurtzm...@gmail.com on 5 Feb 2011 at 8:00