Add map icons

This commit is contained in:
Victor Shcherb 2013-04-13 13:24:59 +02:00
parent c70ddbcbd7
commit 4a5c2e314e
9 changed files with 15 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 3 KiB

View file

@ -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,13 +186,17 @@ 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) {
ArrayList<Recording> o = new ArrayList<Recording>();

View file

@ -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) {

View file

@ -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){