Add map view sherpafy

This commit is contained in:
Victor Shcherb 2014-09-05 02:18:21 +02:00
parent 0541c7c68a
commit dbef043f1c
2 changed files with 14 additions and 2 deletions

View file

@ -36,6 +36,7 @@ public class SherpafyStageItineraryFragment extends SherpafyStageInfoFragment im
osmandMapTileView.removeAllLayers();
MapVectorLayer mapVectorLayer = new MapVectorLayer(null);
MapTextLayer mapTextLayer = new MapTextLayer();
mapTextLayer.setAlwaysVisible(true);
// 5.95 all labels
osmandMapTileView.addLayer(mapTextLayer, 5.95f);
osmandMapTileView.addLayer(mapVectorLayer, 0.5f);
@ -78,6 +79,7 @@ public class SherpafyStageItineraryFragment extends SherpafyStageInfoFragment im
}
protected void onPostExecute(Void result) {
gpxLayer.setGivenGpx(gpx);
calculateLatLon();
osmandMapTileView.refreshMap();
};
}.execute((Void)null);

View file

@ -24,6 +24,8 @@ public class MapTextLayer extends OsmandMapLayer {
public static final int TEXT_LINES = 3;
private Paint paintTextIcon;
private OsmandMapTileView view;
private boolean alwaysVisible;
public interface MapTextProvider<T> {
@ -47,14 +49,22 @@ public class MapTextLayer extends OsmandMapLayer {
}
}
public boolean isAlwaysVisible() {
return alwaysVisible;
}
public void setAlwaysVisible(boolean alwaysVisible) {
this.alwaysVisible = alwaysVisible;
}
public boolean isVisible() {
return view.getSettings().SHOW_POI_LABEL.get();
return view.getSettings().SHOW_POI_LABEL.get() || isAlwaysVisible();
}
@SuppressWarnings("unchecked")
@Override
public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings settings) {
if (!view.getSettings().SHOW_POI_LABEL.get()) {
if (!isVisible()) {
return;
}
TIntHashSet set = new TIntHashSet();