Fix coastlines issues

This commit is contained in:
Victor Shcherb 2012-09-16 19:56:02 +02:00
parent f6fc888186
commit 49c8d80326
2 changed files with 10 additions and 4 deletions

View file

@ -365,14 +365,16 @@ public class MapRenderRepositories {
boolean addBasemapCoastlines = true;
boolean emptyData = zoom > BASEMAP_ZOOM && tempResult.isEmpty() && coastLines.isEmpty();
boolean basemapMissing = zoom <= BASEMAP_ZOOM && basemapCoastLines.isEmpty() && mi == null;
boolean detailedLandData = zoom >= 14 && tempResult.size() > 0;
if(!coastLines.isEmpty()) {
long ms = System.currentTimeMillis();
boolean coastlinesWereAdded = processCoastlines(coastLines, leftX, rightX, bottomY, topY, zoom,
basemapCoastLines.isEmpty(), true, tempResult);
addBasemapCoastlines = !coastlinesWereAdded || zoom <= BASEMAP_ZOOM;
addBasemapCoastlines = (!coastlinesWereAdded && !detailedLandData) || zoom <= BASEMAP_ZOOM;
coastlineTime = "(coastline " + (System.currentTimeMillis() - ms) + " ms )";
}
} else {
addBasemapCoastlines = !detailedLandData;
}
if(addBasemapCoastlines){
long ms = System.currentTimeMillis();
boolean coastlinesWereAdded = processCoastlines(basemapCoastLines, leftX, rightX, bottomY, topY, zoom,

View file

@ -983,11 +983,15 @@ ResultPublisher* searchObjectsForRendering(SearchQuery* q, bool skipDuplicates,
bool land = q->mixed;
bool addBasemapCoastlines = true;
bool emptyData = q->zoom > BASEMAP_ZOOM && tempResult.empty() && coastLines.empty();
// determine if there are enough objects like land/lake..
bool basemapMissing = q->zoom <= BASEMAP_ZOOM && basemapCoastLines.empty() && !basemapExists;
bool detailedLandData = q->zoom >= 14 && tempResult.size() > 0;
if (!coastLines.empty()) {
bool coastlinesWereAdded = processCoastlines(coastLines, q->left, q->right, q->bottom, q->top, q->zoom,
basemapCoastLines.empty(), true, tempResult);
addBasemapCoastlines = !coastlinesWereAdded || q->zoom <= BASEMAP_ZOOM;
addBasemapCoastlines = (!coastlinesWereAdded && !detailedLandData) || q->zoom <= BASEMAP_ZOOM;
} else {
addBasemapCoastlines = !detailedLandData;
}
if (addBasemapCoastlines) {
addBasemapCoastlines = false;