3

I'm trying to use Google Maps with custom tiles. For this, I use the API demo's from Google:

https://github.com/googlemaps/android-samples

and as an example I used TileOverlayDemoActivity as a base. Everything works as expected, but when you zoom in/out and the zoomlevel changes, all the tiles disappear and are being build up again, resulting in a gray screen of about one or two seconds. When you later-on zoom to this level again, the issue is not there, but, if you restart the app, it is there again!

Here is a recording I made from the API Demo's app (this is as-is, I have not changed anything) : https://www.youtube.com/watch?v=OZ3aqLOZ2CY

First I thought the downloading of the tiles took some time, so I tested with using a lightweight TileProvider:

public class MyTileProvider implements TileProvider {

    @Override
    public Tile getTile(int i, int i1, int i2) {
            return new Tile(256, 256, byteArray);
    }
}

where byteArray is always the same, created from a `Bitmap once:

  ByteArrayOutputStream stream = new ByteArrayOutputStream();
  b.compress(Bitmap.CompressFormat.PNG, 100, stream);
  byteArray = stream.toByteArray();

But here, still the same issue.

I don't think there is a solution to this issue, as I haven't found any on the web.

But if someone has a workaround, I could accept that. I am thinking of trying to zoom in from top to bottom for each level so they are drawn once (as I don't see this issue after a zoomlevel has been drawn)

Boy
  • 7,010
  • 4
  • 54
  • 68
  • Maybe it's worth filing a bug in the [public issue tracker](https://code.google.com/p/gmaps-api-issues/issues/list?can=2&q=apitype:Android2%20type:Defect&sort=-stars&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Internal%20Stars). – xomena Oct 20 '16 at 10:25
  • I believe this is already reported, but well, Android bugs YOU need fixed, often don't get enough attention. – Boy Oct 24 '16 at 09:07

1 Answers1

0

I have a workaround for this and answered it on a different question here

Community
  • 1
  • 1
Boy
  • 7,010
  • 4
  • 54
  • 68