[fusion-commits] r1417 - trunk/MapServer/php
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Wed Jun 4 10:02:38 EDT 2008
Author: wbronsema
Date: 2008-06-04 10:02:38 -0400 (Wed, 04 Jun 2008)
New Revision: 1417
Modified:
trunk/MapServer/php/LoadMap.php
Log:
Added check for valid extent when processing getExtent
Modified: trunk/MapServer/php/LoadMap.php
===================================================================
--- trunk/MapServer/php/LoadMap.php 2008-06-04 13:54:14 UTC (rev 1416)
+++ trunk/MapServer/php/LoadMap.php 2008-06-04 14:02:38 UTC (rev 1417)
@@ -144,22 +144,33 @@
$mapObj->layers = array();
for ($i=0;$i<$oMap->numlayers;$i++)
{
- $layer=$oMap->GetLayer($i);
- $layerObj = NULL;
+ $layer=$oMap->getLayer($i);
+ $layerObj = NULL;
- $layerObj->metadata = NULL;
- if (isset($_REQUEST['layer_metadata'])) {
- $layerMetadataKeys = explode(',',$_REQUEST['layer_metadata']);
- foreach($layerMetadataKeys as $key) {
- $layerObj->metadata->$key = $layer->getMetadata($key);
- }
- }
- $extent = $layer->getExtent();
- $layerObj->extent = NULL;
- $layerObj->extent->minx = $extent->minx;
- $layerObj->extent->maxx = $extent->maxx;
- $layerObj->extent->miny = $extent->miny;
- $layerObj->extent->maxy = $extent->maxy;
+ $layerObj->metadata = NULL;
+ if (isset($_REQUEST['layer_metadata'])) {
+ $layerMetadataKeys = explode(',',$_REQUEST['layer_metadata']);
+ foreach($layerMetadataKeys as $key) {
+ $layerObj->metadata->$key = $layer->getMetadata($key);
+ }
+ }
+
+ $extent = $layer->getExtent();
+ $layerObj->extent = NULL;
+ $layerObj->extent->minx = NULL;
+ $layerObj->extent->maxx = NULL;
+ $layerObj->extent->miny = NULL;
+ $layerObj->extent->maxy = NULL;
+
+ // only proceed if extent is valid
+ if( $extent )
+ {
+ $layerObj->extent->minx = $extent->minx;
+ $layerObj->extent->maxx = $extent->maxx;
+ $layerObj->extent->miny = $extent->miny;
+ $layerObj->extent->maxy = $extent->maxy;
+ }
+
$layerObj->propertyMappings = '';
$layerObj->uniqueId = $i;
$layerObj->layerName = $layer->name;
More information about the fusion-commits
mailing list