Fix AND-451 3/4
This commit is contained in:
parent
c749bc1455
commit
19146b21eb
2 changed files with 33 additions and 20 deletions
|
@ -21,6 +21,7 @@ import net.osmand.data.RotatedTileBox;
|
|||
import net.osmand.plus.MapMarkersHelper;
|
||||
import net.osmand.plus.MapMarkersHelper.MapMarker;
|
||||
import net.osmand.plus.OsmAndConstants;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
|
@ -263,26 +264,34 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
|
|||
}
|
||||
}
|
||||
|
||||
boolean show = useFingerLocation && map.getMyApplication().getSettings().SHOW_DESTINATION_ARROW.get();
|
||||
if (show && fingerLocation != null) {
|
||||
List<MapMarker> sortedMapMarkers = markersHelper.getSortedMapMarkers();
|
||||
int i = 0;
|
||||
for (MapMarker marker : sortedMapMarkers) {
|
||||
if (!isLocationVisible(tb, marker)) {
|
||||
canvas.save();
|
||||
net.osmand.Location.distanceBetween(fingerLocation.getLatitude(), fingerLocation.getLongitude(),
|
||||
marker.getLatitude(), marker.getLongitude(), calculations);
|
||||
float bearing = calculations[1] - 90;
|
||||
float radiusBearing = DIST_TO_SHOW * tb.getDensity();
|
||||
final QuadPoint cp = tb.getCenterPixelPoint();
|
||||
canvas.rotate(bearing, cp.x, cp.y);
|
||||
canvas.translate(-24 * tb.getDensity() + radiusBearing, -22 * tb.getDensity());
|
||||
canvas.drawBitmap(arrowToDestination, cp.x, cp.y, getMarkerDestPaint(marker.colorIndex));
|
||||
canvas.restore();
|
||||
}
|
||||
i++;
|
||||
if (i > 1) {
|
||||
break;
|
||||
boolean show = useFingerLocation ||
|
||||
(map.getMyApplication().getSettings().MAP_MARKERS_MODE.get() == OsmandSettings.MapMarkersMode.WIDGETS
|
||||
&& map.getMyApplication().getSettings().SHOW_DESTINATION_ARROW.get());
|
||||
if (show) {
|
||||
LatLon loc = fingerLocation;
|
||||
if (!useFingerLocation) {
|
||||
loc = tb.getCenterLatLon();
|
||||
}
|
||||
if (loc != null) {
|
||||
List<MapMarker> sortedMapMarkers = markersHelper.getSortedMapMarkers();
|
||||
int i = 0;
|
||||
for (MapMarker marker : sortedMapMarkers) {
|
||||
if (!isLocationVisible(tb, marker)) {
|
||||
canvas.save();
|
||||
net.osmand.Location.distanceBetween(loc.getLatitude(), loc.getLongitude(),
|
||||
marker.getLatitude(), marker.getLongitude(), calculations);
|
||||
float bearing = calculations[1] - 90;
|
||||
float radiusBearing = DIST_TO_SHOW * tb.getDensity();
|
||||
final QuadPoint cp = tb.getCenterPixelPoint();
|
||||
canvas.rotate(bearing, cp.x, cp.y);
|
||||
canvas.translate(-24 * tb.getDensity() + radiusBearing, -22 * tb.getDensity());
|
||||
canvas.drawBitmap(arrowToDestination, cp.x, cp.y, getMarkerDestPaint(marker.colorIndex));
|
||||
canvas.restore();
|
||||
}
|
||||
i++;
|
||||
if (i > 1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -234,6 +234,10 @@ public class MapMarkersWidgetsFactory {
|
|||
Location.distanceBetween(marker.getLatitude(), marker.getLongitude(), loc.getLatitude(), loc.getLongitude(), mes);
|
||||
}
|
||||
|
||||
if (customLocation) {
|
||||
heading = 0f;
|
||||
}
|
||||
|
||||
boolean newImage = false;
|
||||
DirectionDrawable dd;
|
||||
if (!(arrowImg.getDrawable() instanceof DirectionDrawable)) {
|
||||
|
|
Loading…
Reference in a new issue