This commit is contained in:
simon 2020-08-31 15:26:28 +03:00
parent 3f9b0f03d4
commit 8a8fcd8d58
3 changed files with 6 additions and 12 deletions

View file

@ -75,13 +75,6 @@ public class ApiRouter {
//canvas.drawBitmap(bitmap ,0, 0, null); //canvas.drawBitmap(bitmap ,0, 0, null);
boolean nightMode = androidContext.getDaynightHelper().isNightMode(); boolean nightMode = androidContext.getDaynightHelper().isNightMode();
OsmandMapMiniLayer.DrawSettings drawSettings = new OsmandMapMiniLayer.DrawSettings(nightMode, false); OsmandMapMiniLayer.DrawSettings drawSettings = new OsmandMapMiniLayer.DrawSettings(nightMode, false);
tileView.refreshMapInternal(drawSettings);
tileView.refreshMap();
MapTileMiniLayer mapTileLayer = new MapTileMiniLayer(true);
//mapView.addLayer(mapTileLayer, 0.0f);
//mapTileLayer.drawTileMap(canvas,tileView.getCurrentRotatedTileBox());
tileView.drawOverMap(canvas,tileView.getCurrentRotatedTileBox(),drawSettings);
//androidContext.getApplicationContext().get
ByteArrayOutputStream stream = new ByteArrayOutputStream(); ByteArrayOutputStream stream = new ByteArrayOutputStream();
//bitmap = tileView.currentCanvas; //bitmap = tileView.currentCanvas;
final QuadRect tilesRect = tileView.getCurrentRotatedTileBox().getTileBounds(); final QuadRect tilesRect = tileView.getCurrentRotatedTileBox().getTileBounds();
@ -91,6 +84,7 @@ public class ApiRouter {
int height = (int) Math.ceil(tilesRect.bottom - top); int height = (int) Math.ceil(tilesRect.bottom - top);
int dzoom = 1; int dzoom = 1;
int div = (int) Math.pow(2.0, dzoom); int div = (int) Math.pow(2.0, dzoom);
tileView.drawOverMap(canvas,tileView.getCurrentRotatedTileBox(),drawSettings);
ResourceManager mgr = androidContext.getResourceManager(); ResourceManager mgr = androidContext.getResourceManager();
int tileX = (left ) / div; int tileX = (left ) / div;

View file

@ -35,9 +35,9 @@ public class LayersDraw {
// 0.5 layer // 0.5 layer
MapVectorMiniLayer mapVectorLayer = new MapVectorMiniLayer(mapTileLayer, false); MapVectorMiniLayer mapVectorLayer = new MapVectorMiniLayer(mapTileLayer, false);
mapView.addLayer(mapVectorLayer, 0.5f); mapView.addLayer(mapVectorLayer, 0.5f);
mapVectorLayer.onPrepareBufferImage(canvas, // mapVectorLayer.onPrepareBufferImage(canvas,
currentTileBlock, // currentTileBlock,
new OsmandMapMiniLayer.DrawSettings(false)); // new OsmandMapMiniLayer.DrawSettings(false));
//DownloadedRegionsLayer downloadedRegionsLayer = new DownloadedRegionsLayer(activity); //DownloadedRegionsLayer downloadedRegionsLayer = new DownloadedRegionsLayer(activity);
//mapView.addLayer(downloadedRegionsLayer, 0.5f); //mapView.addLayer(downloadedRegionsLayer, 0.5f);

View file

@ -715,9 +715,9 @@ public class OsmandMapTileMiniView implements MapTileDownloader.IMapDownloaderCa
if (!layer.drawInScreenPixels()) { if (!layer.drawInScreenPixels()) {
canvas.rotate(tileBox.getRotate(), c.x, c.y); canvas.rotate(tileBox.getRotate(), c.x, c.y);
} }
if (mapRenderer != null) { //if (mapRenderer != null) {
layer.onPrepareBufferImage(canvas, tileBox, drawSettings); layer.onPrepareBufferImage(canvas, tileBox, drawSettings);
} //}
try{ try{
layer.onDraw(canvas, tileBox, drawSettings); layer.onDraw(canvas, tileBox, drawSettings);
} }