[mapguide-users] Defect : Confusion between layer.visible and
layer.isDisplayed
Bruno Scott
bscott at geomapgis.com
Thu Mar 5 10:14:12 EST 2009
Using fiddler i found something interresting in two mapguide ajax functions
QueryFeatureInfo (when selecting a feature )
and
RequestHyperLinkData (when mouse over a feature)
These 2 functions calls GetVisSelLayers or GetVisLayers
then GetLayers(onlyVisible, onlySelectable)
the DoGetLayers
This function returns the list of all either visible and/or selectable
layers
this is the code
function DoGetLayers(nodes, layers, onlyVisible, onlySelectable)
{
for(var i=0; i < nodes.length; i++)
{
var node = nodes[i];
if(node.type == 0)
{
if(onlyVisible && !node.visible)
continue;
if(node.children != null && node.children.length > 0)
DoGetLayers(node.children, layers, onlyVisible,
onlySelectable);
}
else if(node.type == 1)
{
if(onlyVisible && !node.visible)
continue;
if(onlySelectable && !node.selectable)
continue;
layers.push(new Layer(node.legend, node.name, node.objectId));
}
}
}
It should be
function DoGetLayers(nodes, layers, onlyVisible, onlySelectable)
{
for(var i=0; i < nodes.length; i++)
{
var node = nodes[i];
if(node.type == 0)
{
if(onlyVisible && !node.isDisplayed)
continue;
if(node.children != null && node.children.length > 0)
DoGetLayers(node.children, layers, onlyVisible,
onlySelectable);
}
else if(node.type == 1)
{
if(onlyVisible && !node.isDisplayed)
continue;
if(onlySelectable && !node.selectable)
continue;
layers.push(new Layer(node.legend, node.name, node.objectId));
}
}
}
This little defect does not make a big difference on a map like Sheboygan
But mine is Oracle based and has more than 300 layers.
Most of them are eventually visible at a given (low)scale but not displayed
at all.
When i select a feature or i mouse over it, it query the mapguide server
with hundreds of not displayed layers. You bet, things get very slow.
I've made some search on the ajax viewer code and found that this function
is only called by
QueryFeatureInfo
RequestHyperLinkData
selectwithin
Do you aggree that i fill a ticket and a diff patch?
Bruno Scott
--
View this message in context: http://n2.nabble.com/Defect-%3A-Confusion-between-layer.visible-and-layer.isDisplayed-tp2430031p2430031.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list