Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-09-22 10:58:51 +02:00
commit 228022ef20
2 changed files with 15 additions and 11 deletions

View file

@ -139,6 +139,7 @@ public class MapActivityLayers {
mapView.addLayer(mFavouritesLayer, 4);
// 5. transport layer
transportStopsLayer = new TransportStopsLayer(activity);
mapView.addLayer(transportStopsLayer, 5);
// 5.95 all text labels
// 6. point location layer
locationLayer = new PointLocationLayer(activity.getMapViewTrackingUtilities());
@ -179,13 +180,7 @@ public class MapActivityLayers {
OsmandSettings settings = getApplication().getSettings();
updateMapSource(mapView, settings.MAP_TILE_SOURCES);
boolean showStops = settings.getCustomRenderBooleanProperty(OsmandSettings.TRANSPORT_STOPS_OVER_MAP).get();
if (mapView.getLayers().contains(transportStopsLayer) != showStops) {
if (showStops) {
mapView.addLayer(transportStopsLayer, 5);
} else {
mapView.removeLayer(transportStopsLayer);
}
}
transportStopsLayer.setShowTransportStops(showStops);
OsmandPlugin.refreshLayers(mapView, activity);
}

View file

@ -46,6 +46,7 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa
private MapLayerData<List<TransportStop>> data;
private TransportRoute route = null;
private boolean showTransportStops;
private Path path;
public TransportStopsLayer(MapActivity mapActivity) {
@ -149,9 +150,15 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa
public void setRoute(TransportRoute route) {
this.route = route;
}
public boolean isShowTransportStops() {
return showTransportStops;
}
public void setShowTransportStops(boolean showTransportStops) {
this.showTransportStops = showTransportStops;
}
public int getRadiusPoi(RotatedTileBox tb){
final double zoom = tb.getZoom();
int r;
@ -171,7 +178,7 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa
@Override
public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tb,DrawSettings settings) {
public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tb, DrawSettings settings) {
List<TransportStop> objects = null;
if (tb.getZoom() >= startZoomRoute) {
if (route != null) {
@ -200,10 +207,12 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa
}
}
}
if (tb.getZoom() >= startZoom && objects == null) {
if (showTransportStops && tb.getZoom() >= startZoom && objects == null) {
data.queryNewData(tb);
objects = data.getResults();
}
if (objects != null) {
float iconSize = stopBus.getWidth() * 3 / 2.5f;
QuadTree<QuadRect> boundIntersections = initBoundIntersections(tb);