[fusion-commits] r2717 - trunk/layers/MapGuide/php
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Mon May 27 21:20:48 PDT 2013
Author: jng
Date: 2013-05-27 21:20:48 -0700 (Mon, 27 May 2013)
New Revision: 2717
Modified:
trunk/layers/MapGuide/php/LoadMap.php
Log:
#567: Batch up the collection of Feature Source documents in LoadMap.php. This is the correct document we should be passing to IsLayerEditable()
Modified: trunk/layers/MapGuide/php/LoadMap.php
===================================================================
--- trunk/layers/MapGuide/php/LoadMap.php 2013-05-27 09:09:44 UTC (rev 2716)
+++ trunk/layers/MapGuide/php/LoadMap.php 2013-05-28 04:20:48 UTC (rev 2717)
@@ -133,22 +133,28 @@
//layers
$mapObj->layers = array();
$layerDefinitionIds = new MgStringCollection();
-
+ $featureSourceIds = new MgStringCollection();
for($i=0;$i<$layers->GetCount();$i++)
{
$layer = $layers->GetItem($i);
$lid = $layer->GetLayerDefinition();
$layerDefinitionIds->Add($lid->ToString());
+ $featureSourceIds->Add($layer->GetFeatureSourceId());
}
//Get the layer contents in a single batch
$layerDefinitionContents = $resourceService->GetResourceContents($layerDefinitionIds, null);
+ $featureSourceContents = $resourceService->GetResourceContents($featureSourceIds, null);
$layerDocs = array();
+ $fsDocs = array();
for($i=0;$i<$layers->GetCount();$i++)
{
- $content = $layerDefinitionContents->GetItem($i);
- $doc = DOMDocument::LoadXML($content);
- array_push($layerDocs, $doc);
+ $ldfContent = $layerDefinitionContents->GetItem($i);
+ $ldfdoc = DOMDocument::LoadXML($ldfContent);
+ array_push($layerDocs, $ldfdoc);
+ $fsContent = $featureSourceContents->GetItem($i);
+ $fsDoc = DOMDocument::LoadXML($fsContent);
+ array_push($fsDocs, $fsDoc);
}
for($i=0;$i<$layers->GetCount();$i++)
@@ -157,16 +163,17 @@
//not the base map group used for tile maps. (Where is the test for that Y.A.???)
$layer=$layers->GetItem($i);
- $content = $layerDocs[$i];
+ $layerContent = $layerDocs[$i];
+ $fsContent = $fsDocs[$i];
$layerObj = NULL;
- $mappings = GetLayerPropertyMappings($resourceService, $layer, $content);
+ $mappings = GetLayerPropertyMappings($resourceService, $layer, $layerContent);
$_SESSION['property_mappings'][$layer->GetObjectId()] = $mappings;
$layerObj->uniqueId = $layer->GetObjectId();
$layerObj->layerName = addslashes($layer->GetName());
//$aLayerTypes = GetLayerTypes($featureService, $layer);
- $aLayerTypes = GetLayerTypesFromResourceContent($layer, $content);
+ $aLayerTypes = GetLayerTypesFromResourceContent($layer, $layerContent);
$layerObj->layerTypes = $aLayerTypes;
$layerObj->resourceId = $layerDefinitionIds->GetItem($i);
@@ -175,7 +182,7 @@
$layerObj->selectable = $layer->GetSelectable();
$layerObj->visible = $layer->GetVisible();
$layerObj->actuallyVisible = $layer->isVisible();
- $layerObj->editable = IsLayerEditable($resourceService, $layer, $content);
+ $layerObj->editable = IsLayerEditable($resourceService, $layer, $fsContent);
$isBaseMapLayer = ($layer->GetLayerType() == MgLayerType::BaseMap);
$layerObj->isBaseMapLayer = $isBaseMapLayer;
@@ -192,7 +199,7 @@
$layerObj->displayInLegend = $layer->GetDisplayInLegend();
$layerObj->expandInLegend = $layer->GetExpandInLegend();
- $oScaleRanges = buildScaleRanges($layer, $content);
+ $oScaleRanges = buildScaleRanges($layer, $layerContent);
$_SESSION['scale_ranges'][$layer->GetObjectId()] = $oScaleRanges;
//$layerObj->scaleRanges = $oScaleRanges;
/*get the min/max scale for the layer*/
More information about the fusion-commits
mailing list