Fix long native initialization

This commit is contained in:
Victor Shcherb 2011-11-26 13:02:49 +01:00
parent 01ccd70647
commit ea5909882b
2 changed files with 17 additions and 0 deletions

View file

@ -227,6 +227,19 @@ public class BinaryMapIndexReader {
return false;
}
public boolean containsMapData(int left31x, int top31y, int right31x, int bottom31y, int zoom){
for(MapIndex mapIndex : mapIndexes){
for(MapRoot root : mapIndex.getRoots()){
if (root.minZoom <= zoom && root.maxZoom >= zoom) {
if (right31x >= root.left && left31x <= root.right && root.top <= bottom31y && root.bottom >= top31y) {
return true;
}
}
}
}
return false;
}
public boolean containsAddressData(){
return addressIndexes.size() > 0;
}

View file

@ -256,6 +256,10 @@ public class MapRenderRepositories {
if (basemapSearch && !mapName.toLowerCase().contains(BASEMAP_NAME)) {
continue;
}
BinaryMapIndexReader reader = files.get(mapName);
if(!reader.containsMapData(leftX, topY, rightX, bottomY, zoom)) {
continue;
}
if (!nativeFiles.contains(mapName)) {
nativeFiles.add(mapName);
if (!library.initMapFile(mapName)) {