Fix long native initialization
This commit is contained in:
parent
01ccd70647
commit
ea5909882b
2 changed files with 17 additions and 0 deletions
|
@ -227,6 +227,19 @@ public class BinaryMapIndexReader {
|
||||||
return false;
|
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(){
|
public boolean containsAddressData(){
|
||||||
return addressIndexes.size() > 0;
|
return addressIndexes.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,6 +256,10 @@ public class MapRenderRepositories {
|
||||||
if (basemapSearch && !mapName.toLowerCase().contains(BASEMAP_NAME)) {
|
if (basemapSearch && !mapName.toLowerCase().contains(BASEMAP_NAME)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
BinaryMapIndexReader reader = files.get(mapName);
|
||||||
|
if(!reader.containsMapData(leftX, topY, rightX, bottomY, zoom)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!nativeFiles.contains(mapName)) {
|
if (!nativeFiles.contains(mapName)) {
|
||||||
nativeFiles.add(mapName);
|
nativeFiles.add(mapName);
|
||||||
if (!library.initMapFile(mapName)) {
|
if (!library.initMapFile(mapName)) {
|
||||||
|
|
Loading…
Reference in a new issue