Try to fix parking

This commit is contained in:
Victor Shcherb 2012-10-02 20:54:13 +02:00
parent 0d7d3b6bbf
commit c59d020a9f
2 changed files with 8 additions and 8 deletions

View file

@ -75,16 +75,15 @@ public class ParkingPositionLayer extends OsmandMapLayer implements ContextMenuL
bitmapPaint.setFilterBitmap(true);
parkingNoLimitIcon = BitmapFactory.decodeResource(view.getResources(), R.drawable.poi_parking_pos_no_limit);
parkingLimitIcon = BitmapFactory.decodeResource(view.getResources(), R.drawable.poi_parking_pos_limit);
parkingPoint = settings.getParkingPosition();
timeLimit = settings.getParkingType();
}
@Override
public void onDraw(Canvas canvas, RectF latLonBounds, RectF tilesRect, DrawSettings nightMode) {
// settings.clearParkingPosition();
parkingPoint = settings.getParkingPosition();
if (parkingPoint == null)
return;
timeLimit = settings.getParkingType();
Bitmap parkingIcon;
if (!timeLimit) {
parkingIcon = parkingNoLimitIcon;
@ -183,9 +182,10 @@ public class ParkingPositionLayer extends OsmandMapLayer implements ContextMenuL
return view.getContext().getString(R.string.osmand_parking_position_name);
}
public void setParkingPointOnLayer(LatLon point) {
public void setParkingPointOnLayer(LatLon point, boolean timeLimit) {
this.timeLimit = timeLimit;
this.parkingPoint = point;
if (view != null && view.getLayers().contains(ParkingPositionLayer.this)) {
if (view != null) {
view.refreshMap();
}
}

View file

@ -328,8 +328,8 @@ public class ParkingPositionPlugin extends OsmandPlugin {
settings.setParkingPosition(latitude, longitude);
settings.setParkingType(isLimited);
settings.setParkingStartTime(Calendar.getInstance().getTimeInMillis());
if (mapActivity.getMapView().getLayers().contains(parkingLayer)) {
parkingLayer.setParkingPointOnLayer(settings.getParkingPosition());
if (parkingLayer != null) {
parkingLayer.setParkingPointOnLayer(new LatLon(latitude, longitude), isLimited);
}
}