Fix 30m shift for vector map

This commit is contained in:
vshcherb 2013-10-23 23:44:06 +02:00
parent 35b7eda9a3
commit 6c7e6d9c8f
3 changed files with 8 additions and 9 deletions

View file

@ -554,15 +554,15 @@ public class MapRenderRepositories {
currentRenderingContext.shadowRenderingMode = renderingReq.getIntPropertyValue(renderingReq.ALL.R_ATTR_INT_VALUE);
currentRenderingContext.shadowRenderingColor = renderingReq.getIntPropertyValue(renderingReq.ALL.R_SHADOW_COLOR);
}
final QuadPoint lt = requestedBox.getLeftTopTile(requestedBox.getZoom() +
requestedBox.getZoomScale());
//LatLon lt = requestedBox.getLeftTopLatLon();
final QuadPoint lt = requestedBox.getLeftTopTile(requestedBox.getZoom());
// LatLon ltn = requestedBox.getLeftTopLatLon();
final float mapDensity = (float) Math.pow(2, requestedBox.getZoomScale());
final float tileDivisor = (float) MapUtils.getPowZoom(31 - requestedBox.getZoom() -
requestedBox.getZoomScale());
currentRenderingContext.leftX = lt.x;
//MapUtils.get31TileNumberX(lt.getLongitude()) / tileDivisor;
currentRenderingContext.topY = lt.y;//MapUtils.get31TileNumberY(lt.getLatitude()) / tileDivisor;
currentRenderingContext.leftX = (float) (lt.x * MapUtils.getPowZoom(requestedBox.getZoomScale()));
// MapUtils.get31TileNumberX(ltn.getLongitude()) / tileDivisor;
currentRenderingContext.topY = (float) (lt.y * MapUtils.getPowZoom(requestedBox.getZoomScale()));
//MapUtils.get31TileNumberY(ltn.getLatitude()) / tileDivisor;
currentRenderingContext.zoom = requestedBox.getZoom();
currentRenderingContext.rotate = requestedBox.getRotate();
currentRenderingContext.width = requestedBox.getPixWidth();

View file

@ -14,7 +14,6 @@ import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.R;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.graphics.Bitmap;
@ -22,8 +21,6 @@ import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PointF;
import android.util.DisplayMetrics;
import android.view.WindowManager;
import android.widget.Toast;
public class FavoritesLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider {

View file

@ -147,6 +147,8 @@ public class RouteLayer extends OsmandMapLayer {
private void drawSegment(RotatedTileBox tb, Canvas canvas) {
if (points.size() > 0) {
paint.setStrokeWidth(12 * tb.getDensity());
int px = tb.getPixXFromLonNoRot(points.get(0).getLongitude());
int py = tb.getPixYFromLatNoRot(points.get(0).getLatitude());
path.moveTo(px, py);