[fusion-commits] r2543 - in trunk: layers/MapGuide/php widgets/FeatureInfo/classes
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Sat Jul 7 04:51:06 PDT 2012
Author: jng
Date: 2012-07-07 04:51:06 -0700 (Sat, 07 Jul 2012)
New Revision: 2543
Modified:
trunk/layers/MapGuide/php/Utilities.php
trunk/widgets/FeatureInfo/classes/featureinfo.php
Log:
#528: Fix Feature Info widget:
- Only show visible and selectable layers in the layer list
- Fix PHP notice that scrambles return json if (display_errors = On)
Modified: trunk/layers/MapGuide/php/Utilities.php
===================================================================
--- trunk/layers/MapGuide/php/Utilities.php 2012-06-28 20:07:38 UTC (rev 2542)
+++ trunk/layers/MapGuide/php/Utilities.php 2012-07-07 11:51:06 UTC (rev 2543)
@@ -788,15 +788,15 @@
array_push($properties->$layerName->metadatanames, 'area');
array_push($properties->$layerName->metadatanames, 'length');
- //NOTE: PHP will complain about _SESSION being undefined when display_errors = On with full verbosity
- //messing up any JSON response in the process!
- $mappings = $_SESSION['property_mappings'][$layerObj->GetObjectId()];
- foreach((array)$mappings as $name => $value)
- {
- $propType = $featureReader->GetPropertyType($name);
- array_push($properties->$layerName->propertynames, $name);
- array_push($properties->$layerName->propertyvalues, $value);
- array_push($properties->$layerName->propertytypes, $propType);
+ if (isset($_SESSION)) {
+ $mappings = $_SESSION['property_mappings'][$layerObj->GetObjectId()];
+ foreach((array)$mappings as $name => $value)
+ {
+ $propType = $featureReader->GetPropertyType($name);
+ array_push($properties->$layerName->propertynames, $name);
+ array_push($properties->$layerName->propertyvalues, $value);
+ array_push($properties->$layerName->propertytypes, $propType);
+ }
}
$srsTarget = null;
Modified: trunk/widgets/FeatureInfo/classes/featureinfo.php
===================================================================
--- trunk/widgets/FeatureInfo/classes/featureinfo.php 2012-06-28 20:07:38 UTC (rev 2542)
+++ trunk/widgets/FeatureInfo/classes/featureinfo.php 2012-07-07 11:51:06 UTC (rev 2543)
@@ -48,7 +48,7 @@
//TODO: Exclude Raster and Drawing Layers???
- if((substr($layer->GetName(), 0, 1) != "_") && (substr(strtoupper($layer->GetFeatureSourceId()), 0, 7) != "SESSION"))
+ if((substr($layer->GetName(), 0, 1) != "_") && (substr(strtoupper($layer->GetFeatureSourceId()), 0, 7) != "SESSION") && ($layer->IsVisible()) && $layer->GetSelectable())
{
$layerNames[$layer->GetName()] = $layer->GetLegendLabel();
}
More information about the fusion-commits
mailing list