Renamed methods
This commit is contained in:
parent
c3d4b9ec13
commit
cba23728d1
5 changed files with 9 additions and 14 deletions
|
@ -694,9 +694,9 @@ public class OsmandRegions {
|
|||
}
|
||||
}
|
||||
|
||||
public List<WorldRegion> getWoldRegions(LatLon latLon) throws IOException {
|
||||
public List<WorldRegion> getWoldRegionsAt(LatLon latLon) throws IOException {
|
||||
List<WorldRegion> result = new ArrayList<>();
|
||||
List<BinaryMapDataObject> mapDataObjects = getBinaryMapDataObjects(latLon);
|
||||
List<BinaryMapDataObject> mapDataObjects = getBinaryMapDataObjectsAt(latLon);
|
||||
for (BinaryMapDataObject obj : mapDataObjects) {
|
||||
String fullName = getFullName(obj);
|
||||
if (fullName != null) {
|
||||
|
@ -709,8 +709,8 @@ public class OsmandRegions {
|
|||
return result;
|
||||
}
|
||||
|
||||
public BinaryMapDataObject findBinaryMapDataObject(LatLon latLon) throws IOException {
|
||||
List<BinaryMapDataObject> mapDataObjects = getBinaryMapDataObjects(latLon);
|
||||
public BinaryMapDataObject getSmallestBinaryMapDataObjectAt(LatLon latLon) throws IOException {
|
||||
List<BinaryMapDataObject> mapDataObjects = getBinaryMapDataObjectsAt(latLon);
|
||||
BinaryMapDataObject res = null;
|
||||
double smallestArea = -1;
|
||||
for (BinaryMapDataObject o : mapDataObjects) {
|
||||
|
@ -726,7 +726,7 @@ public class OsmandRegions {
|
|||
return res;
|
||||
}
|
||||
|
||||
private List<BinaryMapDataObject> getBinaryMapDataObjects(LatLon latLon) throws IOException {
|
||||
private List<BinaryMapDataObject> getBinaryMapDataObjectsAt(LatLon latLon) throws IOException {
|
||||
int point31x = MapUtils.get31TileNumberX(latLon.getLongitude());
|
||||
int point31y = MapUtils.get31TileNumberY(latLon.getLatitude());
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
|
|||
protected BinaryMapDataObject doInBackground(LatLon... latLons) {
|
||||
try {
|
||||
if (latLons != null && latLons.length > 0) {
|
||||
return app.getRegions().findBinaryMapDataObject(latLons[0]);
|
||||
return app.getRegions().getSmallestBinaryMapDataObjectAt(latLons[0]);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// ignore
|
||||
|
|
|
@ -5,15 +5,12 @@ import android.support.annotation.Nullable;
|
|||
|
||||
import net.osmand.IndexConstants;
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.binary.BinaryMapDataObject;
|
||||
import net.osmand.binary.BinaryMapIndexReader;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.map.OsmandRegions;
|
||||
import net.osmand.map.WorldRegion;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.download.DownloadOsmandIndexesHelper.AssetIndexItem;
|
||||
import net.osmand.plus.inapp.InAppPurchaseHelper;
|
||||
import net.osmand.util.MapUtils;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
|
@ -23,7 +20,6 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
@ -465,7 +461,7 @@ public class DownloadResources extends DownloadResourceGroup {
|
|||
List<IndexItem> res = new ArrayList<>();
|
||||
OsmandRegions regions = app.getRegions();
|
||||
DownloadIndexesThread downloadThread = app.getDownloadThread();
|
||||
List<WorldRegion> downloadRegions = regions.getWoldRegions(latLon);
|
||||
List<WorldRegion> downloadRegions = regions.getWoldRegionsAt(latLon);
|
||||
for (WorldRegion downloadRegion : downloadRegions) {
|
||||
if (includeDownloaded || !isIndexItemDownloaded(downloadThread, type, downloadRegion, res)) {
|
||||
addIndexItem(downloadThread, type, downloadRegion, res);
|
||||
|
|
|
@ -408,7 +408,7 @@ public class SearchDialogFragment extends DialogFragment implements DownloadEven
|
|||
Amenity amenity = cityItem.getAmenity();
|
||||
BinaryMapDataObject o = null;
|
||||
try {
|
||||
o = osmandRegions.findBinaryMapDataObject(amenity.getLocation());
|
||||
o = osmandRegions.getSmallestBinaryMapDataObjectAt(amenity.getLocation());
|
||||
} catch (IOException e) {
|
||||
// ignore
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@ import android.text.Html;
|
|||
import android.util.Log;
|
||||
|
||||
import net.osmand.IndexConstants;
|
||||
import net.osmand.ResultMatcher;
|
||||
import net.osmand.data.Amenity;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.map.OsmandRegions;
|
||||
|
@ -99,7 +98,7 @@ public class WikiArticleHelper {
|
|||
List<WorldRegion> regions = null;
|
||||
if (articleLatLon != null) {
|
||||
try {
|
||||
regions = application.getRegions().getWoldRegions(articleLatLon);
|
||||
regions = application.getRegions().getWoldRegionsAt(articleLatLon);
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, e.getMessage(), e);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue