Fix road only maps
This commit is contained in:
parent
40e85314a0
commit
66961e49f0
2 changed files with 14 additions and 1 deletions
|
@ -289,6 +289,18 @@ public class BinaryMapIndexReader {
|
||||||
return routingIndexes.size() > 0;
|
return routingIndexes.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean containsRouteData(int left31x, int top31y, int right31x, int bottom31y, int zoom) {
|
||||||
|
for (RouteRegion ri : routingIndexes) {
|
||||||
|
List<RouteSubregion> sr = ri.getSubregions();
|
||||||
|
for (RouteSubregion r : sr) {
|
||||||
|
if (right31x >= r.left && left31x <= r.right && r.top <= bottom31y && r.bottom >= top31y) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean containsPoiData(double latitude, double longitude) {
|
public boolean containsPoiData(double latitude, double longitude) {
|
||||||
for (PoiRegion index : poiIndexes) {
|
for (PoiRegion index : poiIndexes) {
|
||||||
if (index.rightLongitude >= longitude && index.leftLongitude <= longitude &&
|
if (index.rightLongitude >= longitude && index.leftLongitude <= longitude &&
|
||||||
|
|
|
@ -260,7 +260,8 @@ public class MapRenderRepositories {
|
||||||
// check that everything is initialized
|
// check that everything is initialized
|
||||||
for (String mapName : files.keySet()) {
|
for (String mapName : files.keySet()) {
|
||||||
BinaryMapIndexReader fr = files.get(mapName);
|
BinaryMapIndexReader fr = files.get(mapName);
|
||||||
if (fr != null && fr.containsMapData(leftX, topY, rightX, bottomY, zoom)) {
|
if (fr != null && (fr.containsMapData(leftX, topY, rightX, bottomY, zoom) ||
|
||||||
|
fr.containsRouteData(leftX, topY, rightX, bottomY, zoom))) {
|
||||||
if (!nativeFiles.contains(mapName)) {
|
if (!nativeFiles.contains(mapName)) {
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
nativeFiles.add(mapName);
|
nativeFiles.add(mapName);
|
||||||
|
|
Loading…
Reference in a new issue