[fusion-trac] #77: Function "getGroupObject(..)" in
MapServer/php/LoadMap.php not quering group information correctly
Fusion
trac_fusion at osgeo.org
Thu Sep 18 08:39:20 EDT 2008
#77: Function "getGroupObject(..)" in MapServer/php/LoadMap.php not quering
group information correctly
-------------------------+--------------------------------------------------
Reporter: schneiderei | Owner: madair
Type: enhancement | Status: new
Priority: P2 | Milestone: 2.0
Component: MapServer | Version: 1.0.6
Severity: Critical | Resolution:
Keywords: | External_id:
State: Analysing | Browser: All
Os: All |
-------------------------+--------------------------------------------------
Changes (by pagameba):
* state: New => Analysing
* type: defect => enhancement
* milestone: 1.1 => 2.0
Comment:
The relevant code is:
{{{
$aGroups = $oMap->getAllGroupNames();
foreach($aGroups as $groupName) {
$aLayerIndexes = $oMap->getLayersIndexByGroup($groupName);
if (count($aLayerIndexes) > 0) {
array_push($mapObj->groups,
getGroupObject($oMap->getLayer($aLayerIndexes[0])));
}
}
}}}
First we get all the group names, then we get all the indexes of the
layers that belong to each group, then we get the group information from
the first layer in the group.
As far as I know, there is no such thing as a '''group layer'''. This
seems to be your own convention - naming a layer by the group name.
Perhaps I am wrong? But there certainly doesn't need to be a layer named
the same as the group name.
I believe that the correct way to get group information is from the first
layer in the group (as it appears in the map file). This could be
inconvenient for managing map files and I wouldn't mind having this loop
over all the layers and stopping at the first layer that has the
groupLegendLabel metadata so that the metadata can be added to any layer
in the group and it will still work, even if you move layers around in the
drawing order.
--
Ticket URL: <http://trac.osgeo.org/fusion/ticket/77#comment:1>
Fusion <http://trac.osgeo.org/fusion>
Fusion is a web-mapping application development framework for MapServer and MapGuide OS.
More information about the fusion-trac
mailing list