Add map icons
Before Width: | Height: | Size: 104 B After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 3 KiB |
|
@ -99,7 +99,7 @@ public class AudioNotesLayer extends OsmandMapLayer implements IContextMenuProvi
|
|||
b = video;
|
||||
|
||||
}
|
||||
canvas.drawBitmap(b, x - b.getWidth() / 2, y - b.getHeight() / 2, paintIcon);
|
||||
canvas.drawBitmap(b, x - b.getWidth() / 2, y - b.getHeight(), paintIcon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -186,12 +186,16 @@ public class AudioNotesLayer extends OsmandMapLayer implements IContextMenuProvi
|
|||
for (Recording n : plugin.getAllRecordings()) {
|
||||
int x = view.getRotatedMapXForPoint(n.getLatitude(), n.getLongitude());
|
||||
int y = view.getRotatedMapYForPoint(n.getLatitude(), n.getLongitude());
|
||||
if (Math.abs(x - ex) <= compare && Math.abs(y - ey) <= compare) {
|
||||
if (calculateBelongs(ex, ey, x, y, compare)) {
|
||||
compare = radius;
|
||||
am.add(n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean calculateBelongs(int ex, int ey, int objx, int objy, int radius) {
|
||||
return Math.abs(objx - ex) <= radius && (ey - objy) <= radius / 2 && (objy - ey) <= 3 * radius ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSingleTap(PointF point) {
|
||||
|
|
|
@ -194,6 +194,8 @@ public class DistanceCalculatorPlugin extends OsmandPlugin {
|
|||
public void onDraw(Canvas canvas, RectF latlonRect, RectF tilesRect, DrawSettings settings) {
|
||||
if (distanceMeasurementMode != 0) {
|
||||
path.reset();
|
||||
int marginY = originIcon.getHeight();
|
||||
int marginX = originIcon.getWidth() / 2;
|
||||
for (int i = 0; i < measurementPoints.size(); i++) {
|
||||
LatLon point = measurementPoints.get(i);
|
||||
double lat = point.getLatitude();
|
||||
|
@ -201,10 +203,9 @@ public class DistanceCalculatorPlugin extends OsmandPlugin {
|
|||
int locationX = view.getMapXForPoint(lon);
|
||||
int locationY = view.getMapYForPoint(lat);
|
||||
if (view.isPointOnTheRotatedMap(lat, lon)) {
|
||||
int marginY = originIcon.getHeight();
|
||||
canvas.rotate(-view.getRotate(), locationX, locationY);
|
||||
canvas.drawBitmap(distanceMeasurementMode == 1? originIcon : destinationIcon,
|
||||
locationX, locationY - marginY, bitmapPaint);
|
||||
locationX - marginX, locationY - marginY, bitmapPaint);
|
||||
canvas.rotate(view.getRotate(), locationX, locationY);
|
||||
}
|
||||
if (i == 0) {
|
||||
|
|
|
@ -159,6 +159,7 @@ public class PointNavigationLayer extends OsmandMapLayer implements IContextMenu
|
|||
public void collectObjectsFromPoint(PointF point, List<Object> o) {
|
||||
TargetPointsHelper tg = map.getMyApplication().getTargetPointsHelper();
|
||||
List<LatLon> intermediatePoints = tg.getIntermediatePointsWithTarget();
|
||||
int r = getRadiusPoi(view.getZoom());
|
||||
for (int i = 0; i < intermediatePoints.size(); i++) {
|
||||
LatLon latLon = intermediatePoints.get(i);
|
||||
boolean target = i == intermediatePoints.size() - 1;
|
||||
|
@ -167,8 +168,7 @@ public class PointNavigationLayer extends OsmandMapLayer implements IContextMenu
|
|||
int ey = (int) point.y;
|
||||
int x = view.getRotatedMapXForPoint(latLon.getLatitude(), latLon.getLongitude());
|
||||
int y = view.getRotatedMapYForPoint(latLon.getLatitude(), latLon.getLongitude());
|
||||
int r = getRadiusPoi(view.getZoom());
|
||||
if (Math.abs(x - ex) <= r && Math.abs(y - ey) <= r) {
|
||||
if (calculateBelongs(ex, ey, x, y, r)) {
|
||||
TargetPoint tp = new TargetPoint();
|
||||
tp.location = latLon;
|
||||
tp.intermediate = !target;
|
||||
|
@ -186,6 +186,10 @@ public class PointNavigationLayer extends OsmandMapLayer implements IContextMenu
|
|||
|
||||
}
|
||||
|
||||
private boolean calculateBelongs(int ex, int ey, int objx, int objy, int radius) {
|
||||
return Math.abs(objx - ex) <= radius && (ey - objy) <= radius && (objy - ey) <= 2.5 * radius ;
|
||||
}
|
||||
|
||||
public int getRadiusPoi(int zoom){
|
||||
int r = 0;
|
||||
if(zoom <= 15){
|
||||
|
|