Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-02-27 07:33:48 +01:00
commit fc583bd5c5

View file

@ -22,6 +22,7 @@ import net.osmand.plus.MapMarkersHelper;
import net.osmand.plus.MapMarkersHelper.MapMarker;
import net.osmand.plus.OsmAndConstants;
import net.osmand.plus.R;
import net.osmand.plus.TargetPointsHelper.TargetPoint;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.views.ContextMenuLayer.IContextMenuProvider;
import net.osmand.plus.views.ContextMenuLayer.IContextMenuProviderSelection;
@ -250,7 +251,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
List<MapMarker> activeMapMarkers = markersHelper.getActiveMapMarkers();
for (int i = 0; i < activeMapMarkers.size(); i++) {
MapMarker marker = activeMapMarkers.get(i);
if (isLocationVisible(tb, marker)) {
if (isLocationVisible(tb, marker) && !overlappedByWaypoint(marker)) {
Bitmap bmp = getMapMarkerBitmap(marker.colorIndex);
int marginX = bmp.getWidth() / 6;
int marginY = bmp.getHeight();
@ -304,6 +305,16 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
return tx >= 0 && tx <= tb.getPixWidth() && ty >= widgetHeight && ty <= tb.getPixHeight();
}
public boolean overlappedByWaypoint(MapMarker marker) {
List<TargetPoint> targetPoints = map.getMyApplication().getTargetPointsHelper().getAllPoints();
for (TargetPoint t : targetPoints) {
if (t.point.equals(marker.point)) {
return true;
}
}
return false;
}
@Override
public void destroyLayer() {
}