Osmdroid GoogleTilesOverlay smooth resizing

Following the example of Google Tile Wrapper, I implemented Google MapView with osmdroid GoogleTilesOverlay.

    com.google.android.maps.MapView googleMapView;
    org.osmdroid.google.wrapper.MapView osmdMapView;
    org.osmdroid.google.overlay.GoogleTilesOverlay tiles;

    final MapView googleMapView = (com.google.android.maps.MapView.MapView) findViewById(R.id.plan_mapview);
    osmdMapView = new org.osmdroid.google.wrapper.MapView(gMapView);

    // snip Provider instantiation etc.

   overlayTiles = new GoogleTilesOverlay(provider, getApplicationContext());
   gMapView.getOverlays().add(overlayTiles);

At rest, overlay tiles render fine, but when scaling (pinching or using controls), the changing sizes of google’s key syllables change smoothly, however, osmd omelets do not change.

Result: when scaling fragments that remain in the field of view, they begin to overlap. Conversely, when scaling between each plate, the gap becomes visible.

It seems to me that the first step is to subclass GoogleTilesOverlay, so that I can change the draw () method. But then what?

Google : a) draw(), b) Projector/Matrix, ,

, API Android, , ... .

+3
1

draw GoogleTilesOverlay.

(x,y,x+tileSizePx,y+tileSizePx).

, (x,y and x+1,y+1) .

:

                final GeoPoint geoPointUL = new GeoPoint(
                        (int) (Mercator.tile2lat(y, zoomLevel) * 1E6),
                        (int) (Mercator.tile2lon(x, zoomLevel) * 1E6));                    

                final GeoPoint geoPointLR = new GeoPoint(
                        (int) (Mercator.tile2lat(y+1, zoomLevel) * 1E6),
                        (int) (Mercator.tile2lon(x+1, zoomLevel) * 1E6));

                Point pointUL=new Point(), pointLR=new Point();
                pj.toPixels(geoPointUL, pointUL);
                pj.toPixels(geoPointLR, pointLR);
                tileSizePx = pointLR.x - pointUL.x;
+2

All Articles