fixed show tiles - now we only show tiles that belong to the same basemap

This commit is contained in:
Javier Abadia 2014-07-16 13:22:30 -07:00
parent ca52301973
commit ab53a32f1e

View File

@ -261,16 +261,15 @@ define([
var tilingScheme = new TilingScheme(this);
store.getAllTiles(function(url,img,err)
{
if(url)
if(url && url.indexOf(layer.url) == 0)
{
if(url.indexOf("_alllayers") != -1)
{
// V101/LAYERS/_alllayers/L01/R0C18C0B10
components = url.split("/");
level = parseInt(components[ components.length - 2].slice(1),10);
// how to extract row and col?
//col = parseInt( components[ components.length -1]);
//row = parseInt( components[ components.length -1]);
col = parseInt( components[ components.length -1].substring(1,5), 16);
row = parseInt( components[ components.length -1].substring(6,10), 16);
}
else
{
@ -278,14 +277,17 @@ define([
level = parseInt(components[ components.length - 3],10);
col = parseInt(components[ components.length - 2],10);
row = parseInt(components[ components.length - 1],10);
cellId = [row,col];
polygon = tilingScheme.getCellPolygonFromCellId(cellId, level);
callback(polygon);
}
cellId = [row,col];
polygon = tilingScheme.getCellPolygonFromCellId(cellId, level);
callback(polygon);
}
else
{
callback(null,err);
if(!url)
{
callback(null,err);
}
}
});
};