Merge pull request #7900 from osmandapp/ShowAlongTheRouteFix
Show Along The Route POI icons size Fix
This commit is contained in:
commit
6e801c232e
2 changed files with 18 additions and 1 deletions
|
@ -110,6 +110,20 @@ public class WaypointHelper {
|
||||||
public boolean isPointPassed(LocationPointWrapper point) {
|
public boolean isPointPassed(LocationPointWrapper point) {
|
||||||
return route.isPointPassed(point.routeIndex);
|
return route.isPointPassed(point.routeIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isAmenityNoPassed(Amenity a) {
|
||||||
|
if (a != null) {
|
||||||
|
List<LocationPointWrapper> points = locationPoints.get(POI);
|
||||||
|
for (LocationPointWrapper point : points) {
|
||||||
|
if (point.point instanceof AmenityLocationPoint) {
|
||||||
|
if (a.equals(((AmenityLocationPoint) point.point).a)) {
|
||||||
|
return !isPointPassed(point);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public void removeVisibleLocationPoint(LocationPointWrapper lp) {
|
public void removeVisibleLocationPoint(LocationPointWrapper lp) {
|
||||||
if (lp.type < locationPoints.size()) {
|
if (lp.type < locationPoints.size()) {
|
||||||
|
|
|
@ -36,6 +36,7 @@ import net.osmand.osm.PoiType;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.activities.MapActivity;
|
import net.osmand.plus.activities.MapActivity;
|
||||||
|
import net.osmand.plus.helpers.WaypointHelper;
|
||||||
import net.osmand.plus.poi.PoiUIFilter;
|
import net.osmand.plus.poi.PoiUIFilter;
|
||||||
import net.osmand.plus.render.RenderingIcons;
|
import net.osmand.plus.render.RenderingIcons;
|
||||||
import net.osmand.plus.routing.IRouteInformationListener;
|
import net.osmand.plus.routing.IRouteInformationListener;
|
||||||
|
@ -222,6 +223,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
|
||||||
if (objects != null) {
|
if (objects != null) {
|
||||||
float iconSize = poiBackground.getWidth() * 3 / 2;
|
float iconSize = poiBackground.getWidth() * 3 / 2;
|
||||||
QuadTree<QuadRect> boundIntersections = initBoundIntersections(tileBox);
|
QuadTree<QuadRect> boundIntersections = initBoundIntersections(tileBox);
|
||||||
|
WaypointHelper wph = app.getWaypointHelper();
|
||||||
|
|
||||||
for (Amenity o : objects) {
|
for (Amenity o : objects) {
|
||||||
float x = tileBox.getPixXFromLatLon(o.getLocation().getLatitude(), o.getLocation()
|
float x = tileBox.getPixXFromLatLon(o.getLocation().getLatitude(), o.getLocation()
|
||||||
|
@ -230,7 +232,8 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
|
||||||
.getLongitude());
|
.getLongitude());
|
||||||
|
|
||||||
if (tileBox.containsPoint(x, y, iconSize)) {
|
if (tileBox.containsPoint(x, y, iconSize)) {
|
||||||
if (intersects(boundIntersections, x, y, iconSize, iconSize)) {
|
if (intersects(boundIntersections, x, y, iconSize, iconSize) ||
|
||||||
|
(app.getSettings().SHOW_NEARBY_POI.get() && wph.isRouteCalculated() && !wph.isAmenityNoPassed(o))) {
|
||||||
canvas.drawBitmap(poiBackgroundSmall, x - poiBackgroundSmall.getWidth() / 2, y - poiBackgroundSmall.getHeight() / 2, paintIconBackground);
|
canvas.drawBitmap(poiBackgroundSmall, x - poiBackgroundSmall.getWidth() / 2, y - poiBackgroundSmall.getHeight() / 2, paintIconBackground);
|
||||||
smallObjectsLatLon.add(new LatLon(o.getLocation().getLatitude(),
|
smallObjectsLatLon.add(new LatLon(o.getLocation().getLatitude(),
|
||||||
o.getLocation().getLongitude()));
|
o.getLocation().getLongitude()));
|
||||||
|
|
Loading…
Reference in a new issue