Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-03-22 17:57:58 +01:00
commit 4f9c362cbc
11 changed files with 67 additions and 42 deletions

View file

@ -169,8 +169,10 @@ public class AudioNotesLayer extends OsmandMapLayer implements IContextMenuProvi
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> objects) {
if (tileBox.getZoom() >= startZoom) {
getRecordingsFromPoint(point, tileBox, objects);
}
}
public void getRecordingsFromPoint(PointF point, RotatedTileBox tileBox, List<? super Recording> am) {
int ex = (int) point.x;

View file

@ -532,8 +532,10 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> res) {
if (tileBox.getZoom() >= startZoom) {
getBugFromPoint(tileBox, point, res);
}
}
@Override
public LatLon getObjectLocation(Object o) {

View file

@ -56,13 +56,15 @@ public class OsmEditsLayer extends OsmandMapLayer implements ContextMenuLayer.IC
@Override
public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings settings) {
if (tileBox.getZoom() >= startZoom) {
drawPoints(canvas, tileBox, plugin.getDBBug().getOsmbugsPoints());
drawPoints(canvas, tileBox, plugin.getDBPOI().getOpenstreetmapPoints());
List<LatLon> fullObjectsLatLon = new ArrayList<>();
drawPoints(canvas, tileBox, plugin.getDBBug().getOsmbugsPoints(), fullObjectsLatLon);
drawPoints(canvas, tileBox, plugin.getDBPOI().getOpenstreetmapPoints(), fullObjectsLatLon);
this.fullObjectsLatLon = fullObjectsLatLon;
}
}
private void drawPoints(Canvas canvas, RotatedTileBox tileBox, List<? extends OsmPoint> objects) {
List<LatLon> fullObjectsLatLon = new ArrayList<>();
private void drawPoints(Canvas canvas, RotatedTileBox tileBox, List<? extends OsmPoint> objects,
List<LatLon> fullObjectsLatLon) {
for (OsmPoint o : objects) {
float x = tileBox.getPixXFromLatLon(o.getLatitude(), o.getLongitude());
float y = tileBox.getPixYFromLatLon(o.getLatitude(), o.getLongitude());
@ -77,7 +79,6 @@ public class OsmEditsLayer extends OsmandMapLayer implements ContextMenuLayer.IC
canvas.drawBitmap(b, x - b.getWidth() / 2, y - b.getHeight() / 2, paintIcon);
fullObjectsLatLon.add(new LatLon(o.getLatitude(), o.getLongitude()));
}
this.fullObjectsLatLon = fullObjectsLatLon;
}
@Override
@ -144,8 +145,10 @@ public class OsmEditsLayer extends OsmandMapLayer implements ContextMenuLayer.IC
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> o) {
if (tileBox.getZoom() >= startZoom) {
getOsmEditsFromPoint(point, tileBox, o);
}
}
@Override
public LatLon getObjectLocation(Object o) {

View file

@ -282,13 +282,13 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
true).getIntrinsicWidth() * 3 / 2.5f;
QuadTree<QuadRect> boundIntersections = initBoundIntersections(tileBox);
List<LatLon> fullObjectsLatLon = new ArrayList<>();
List<LatLon> smallObjectsLatLon = new ArrayList<>();
// request to load
final QuadRect latLonBounds = tileBox.getLatLonBounds();
for (SelectedGpxFile g : selectedGPXFiles) {
List<WptPt> pts = getListStarPoints(g);
List<WptPt> fullObjects = new ArrayList<>();
List<LatLon> fullObjectsLatLon = new ArrayList<>();
List<LatLon> smallObjectsLatLon = new ArrayList<>();
int fcolor = g.getColor() == 0 ? defPointColor : g.getColor();
for (WptPt o : pts) {
if (o.lat >= latLonBounds.bottom && o.lat <= latLonBounds.top
@ -317,11 +317,11 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
FavoriteImageDrawable fid = FavoriteImageDrawable.getOrCreate(view.getContext(), pointColor, true);
fid.drawBitmapInCenter(canvas, x, y);
}
}
this.fullObjectsLatLon = fullObjectsLatLon;
this.smallObjectsLatLon = smallObjectsLatLon;
}
}
}
private void drawSelectedFilesSegments(Canvas canvas, RotatedTileBox tileBox,
List<SelectedGpxFile> selectedGPXFiles, DrawSettings settings) {
@ -484,8 +484,10 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> res) {
if (tileBox.getZoom() >= startZoom) {
getWptFromPoint(tileBox, point, res);
}
}
@Override
public LatLon getObjectLocation(Object o) {

View file

@ -117,6 +117,7 @@ public class ImpassableRoadsLayer extends OsmandMapLayer implements ContextMenuL
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> o) {
if (tileBox.getZoom() >= startZoom) {
int ex = (int) point.x;
int ey = (int) point.y;
int compare = getRadiusPoi(tileBox);
@ -132,6 +133,7 @@ public class ImpassableRoadsLayer extends OsmandMapLayer implements ContextMenuL
}
}
}
}
@Override
public LatLon getObjectLocation(Object o) {

View file

@ -392,6 +392,10 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> o) {
if (tileBox.getZoom() < 3 || !map.getMyApplication().getSettings().USE_MAP_MARKERS.get()) {
return;
}
MapMarkersHelper markersHelper = map.getMyApplication().getMapMarkersHelper();
List<MapMarker> markers = markersHelper.getActiveMapMarkers();
int r = getRadiusPoi(tileBox);

View file

@ -820,6 +820,10 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
}
}
if (twoFingerTapDetector.onTouchEvent(event)) {
ContextMenuLayer contextMenuLayer = getLayerByClass(ContextMenuLayer.class);
if (contextMenuLayer != null) {
contextMenuLayer.onTouchEvent(event, getCurrentRotatedTileBox());
}
return true;
}

View file

@ -507,8 +507,10 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> objects) {
if (tileBox.getZoom() >= startZoom) {
getAmenityFromPoint(tileBox, point, objects);
}
}
@Override
public LatLon getObjectLocation(Object o) {

View file

@ -165,8 +165,10 @@ public class PointLocationLayer extends OsmandMapLayer implements ContextMenuLay
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> o) {
if (tileBox.getZoom() >= 3) {
getMyLocationFromPoint(tileBox, point, o);
}
}
@Override
public LatLon getObjectLocation(Object o) {

View file

@ -180,6 +180,7 @@ public class PointNavigationLayer extends OsmandMapLayer implements IContextMenu
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> o) {
if (tileBox.getZoom() >= 3) {
TargetPointsHelper tg = map.getMyApplication().getTargetPointsHelper();
List<TargetPoint> intermediatePoints = tg.getAllPoints();
int r = getRadiusPoi(tileBox);
@ -196,8 +197,7 @@ public class PointNavigationLayer extends OsmandMapLayer implements IContextMenu
}
}
}
}
}
private boolean calculateBelongs(int ex, int ey, int objx, int objy, int radius) {

View file

@ -205,8 +205,10 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> res) {
if (tileBox.getZoom() >= startZoom) {
getFromPoint(tileBox, point, res);
}
}
@Override
public LatLon getObjectLocation(Object o) {