git-svn-id: https://osmand.googlecode.com/svn/trunk@137 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-06-04 09:33:31 +00:00
parent c33c6e4b8f
commit c0efd98ff6
2 changed files with 4 additions and 2 deletions

View file

@ -54,6 +54,7 @@ public class Amenity extends MapObject {
prebuiltMap.put("bus_station", AmenityType.TRANSPORTATION);
prebuiltMap.put("car_rental", AmenityType.TRANSPORTATION);
prebuiltMap.put("car_sharing", AmenityType.TRANSPORTATION);
prebuiltMap.put("fuel", AmenityType.TRANSPORTATION);
prebuiltMap.put("car_wash", AmenityType.TRANSPORTATION);
prebuiltMap.put("grit_bin", AmenityType.TRANSPORTATION);
prebuiltMap.put("parking", AmenityType.TRANSPORTATION);

View file

@ -44,6 +44,7 @@ public class SearchPOIActivity extends ListActivity {
private Button searchPOILevel;
private final static int maxCount = 100;
private final static int finalZoom = 8;
private final static int limitOfClosest = 30;
private int zoom = 13;
private AmenityType amenityType;
@ -86,13 +87,13 @@ public class SearchPOIActivity extends ListActivity {
.getLongitude(), zoom, maxCount);
} else {
amenityList = resourceManager.searchAmenities(amenityType, lastKnownMapLocation.getLatitude(), lastKnownMapLocation
.getLongitude(), zoom, maxCount);
.getLongitude(), zoom + 2, maxCount);
}
if (amenityList != null) {
MapUtils.sortListOfMapObject(amenityList, lastKnownMapLocation.getLatitude(), lastKnownMapLocation.getLongitude());
if(amenityType == null){
while (amenityList.size() > 30) {
while (amenityList.size() > limitOfClosest) {
amenityList.remove(amenityList.size() - 1);
}
}