diff --git a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryRasterLayer.java b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryRasterLayer.java index 47c660e560..20c5a64261 100644 --- a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryRasterLayer.java +++ b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryRasterLayer.java @@ -42,10 +42,9 @@ class MapillaryRasterLayer extends MapTileLayer implements MapillaryLayer { this.selectedImageCameraAngle = selectedImageCameraAngle; } - @Override - public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings drawSettings) { - super.onPrepareBufferImage(canvas, tileBox, drawSettings); + private void drawSelectedPoint(Canvas canvas, RotatedTileBox tileBox) { if (selectedImageLocation != null) { + canvas.rotate(-tileBox.getRotate(), tileBox.getCenterPixelX(), tileBox.getCenterPixelY()); float x = tileBox.getPixXFromLatLon(selectedImageLocation.getLatitude(), selectedImageLocation.getLongitude()); float y = tileBox.getPixYFromLatLon(selectedImageLocation.getLatitude(), selectedImageLocation.getLongitude()); if (selectedImageCameraAngle != null) { @@ -56,6 +55,7 @@ class MapillaryRasterLayer extends MapTileLayer implements MapillaryLayer { canvas.restore(); } canvas.drawBitmap(selectedImage, x - selectedImage.getWidth() / 2, y - selectedImage.getHeight() / 2, paintIcon); + canvas.rotate(tileBox.getRotate(), tileBox.getCenterPixelX(), tileBox.getCenterPixelY()); } } @@ -70,5 +70,6 @@ class MapillaryRasterLayer extends MapTileLayer implements MapillaryLayer { return; } super.drawTileMap(canvas, tileBox); + drawSelectedPoint(canvas, tileBox); } } diff --git a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryVectorLayer.java b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryVectorLayer.java index 7dda81194a..acff984a8a 100644 --- a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryVectorLayer.java +++ b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryVectorLayer.java @@ -82,8 +82,11 @@ class MapillaryVectorLayer extends MapTileLayer implements MapillaryLayer, ICont } @Override - public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings drawSettings) { - super.onPrepareBufferImage(canvas, tileBox, drawSettings); + public boolean drawInScreenPixels() { + return true; + } + + private void drawSelectedPoint(Canvas canvas, RotatedTileBox tileBox) { if (selectedImageLocation != null) { float x = tileBox.getPixXFromLatLon(selectedImageLocation.getLatitude(), selectedImageLocation.getLongitude()); float y = tileBox.getPixYFromLatLon(selectedImageLocation.getLatitude(), selectedImageLocation.getLongitude()); @@ -155,6 +158,7 @@ class MapillaryVectorLayer extends MapTileLayer implements MapillaryLayer, ICont } } this.visiblePoints = visiblePoints; + drawSelectedPoint(canvas, tileBox); } protected void drawPoints(Canvas canvas, RotatedTileBox tileBox, int tileX, int tileY, @@ -168,7 +172,6 @@ class MapillaryVectorLayer extends MapTileLayer implements MapillaryLayer, ICont float ph = point.getHeight(); float pwd = pw / 2; float phd = ph / 2; - canvas.rotate(-tileBox.getRotate(), tileBox.getCenterPixelX(), tileBox.getCenterPixelY()); for (Geometry g : tile.getData()) { if (g instanceof Point && !g.isEmpty() && g.getUserData() != null && g.getUserData() instanceof HashMap) { @@ -185,7 +188,6 @@ class MapillaryVectorLayer extends MapTileLayer implements MapillaryLayer, ICont } } } - canvas.rotate(tileBox.getRotate(), tileBox.getCenterPixelX(), tileBox.getCenterPixelY()); } protected void drawLines(Canvas canvas, RotatedTileBox tileBox, int tileX, int tileY, GeometryTile tile) { @@ -216,7 +218,6 @@ class MapillaryVectorLayer extends MapTileLayer implements MapillaryLayer, ICont int mult = (int) Math.pow(2.0, dzoom); QuadRect tileBounds = tileBox.getTileBounds(); - canvas.rotate(-tileBox.getRotate(), tileBox.getCenterPixelX(), tileBox.getCenterPixelY()); Coordinate lastPt = points[0]; float x; float y; @@ -257,7 +258,6 @@ class MapillaryVectorLayer extends MapTileLayer implements MapillaryLayer, ICont lx = px; ly = py; } - canvas.rotate(tileBox.getRotate(), tileBox.getCenterPixelX(), tileBox.getCenterPixelY()); } }