Fix AND-451 3/4

This commit is contained in:
Alexey Kulish 2016-04-08 19:07:12 +03:00
parent c749bc1455
commit 19146b21eb
2 changed files with 33 additions and 20 deletions

View file

@ -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,14 +264,21 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
}
}
boolean show = useFingerLocation && map.getMyApplication().getSettings().SHOW_DESTINATION_ARROW.get();
if (show && fingerLocation != null) {
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(fingerLocation.getLatitude(), fingerLocation.getLongitude(),
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();
@ -287,6 +295,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
}
}
}
}
public boolean isLocationVisible(RotatedTileBox tb, MapMarker marker) {
if (marker == null || tb == null) {

View file

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