[fusion-commits] r1593 - trunk/MapServer/php
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Fri Oct 10 14:56:03 EDT 2008
Author: Assefa
Date: 2008-10-10 14:56:03 -0400 (Fri, 10 Oct 2008)
New Revision: 1593
Modified:
trunk/MapServer/php/LoadScaleRanges.php
Log:
Correct bug with raster layers and icons (#131)
Modified: trunk/MapServer/php/LoadScaleRanges.php
===================================================================
--- trunk/MapServer/php/LoadScaleRanges.php 2008-10-10 15:26:57 UTC (rev 1592)
+++ trunk/MapServer/php/LoadScaleRanges.php 2008-10-10 18:56:03 UTC (rev 1593)
@@ -68,11 +68,12 @@
for($i=0;$i<$oMap->numlayers;$i++)
{
- if (isset($_SESSION['scale_ranges']) &&
- isset($_SESSION['scale_ranges'][$i]))
+ if (isset($_SESSION['scale_ranges']) && isset($_SESSION['scale_ranges'][$i]))
{
$layer = $oMap->getLayer($i);
$scaleranges = $_SESSION['scale_ranges'][$i];
+ //print_r($scaleranges);
+ //echo "aaa <br>";
$layerObj = NULL;
$layerObj->uniqueId = $i;
@@ -99,35 +100,37 @@
$layerObj->scaleRanges = $scaleranges;
array_push($scaleObj->layers, $layerObj);
}
+ }
+
+if ($nTotalClasses > 0)
+ {
+ //build and image containing all the icons and return url
+ $nTmpWidth = $oMap->width;
+ $nTmpHeight = $oMap->height;
- //build and image containing all the icons and return url
- $nTmpWidth = $oMap->width;
- $nTmpHeight = $oMap->height;
-
- $oMap->set("width", $nTotalClasses*$nIconWidth);
- $oMap->set("height", $nIconHeight);
- $oImage = $oMap->prepareImage();
+ $oMap->set("width", $nTotalClasses*$nIconWidth);
+ $oMap->set("height", $nIconHeight);
+ $oImage = $oMap->prepareImage();
- $oMap->set("width", $nTmpWidth);
- $oMap->set("height", $nTmpHeight);
+ $oMap->set("width", $nTmpWidth);
+ $oMap->set("height", $nTmpHeight);
- for ($i=0; $i<$nTotalClasses;$i++)
- $oImage->pasteImage($aIcons[$i], -1, $i*$nIconWidth, 0);
+ for ($i=0; $i<$nTotalClasses;$i++)
+ $oImage->pasteImage($aIcons[$i], -1, $i*$nIconWidth, 0);
- //set the image path and image dir based on what fusion config file
- $configObj = $_SESSION['fusionConfig'];
- if (isset($configObj->mapserver->imagePath) && isset($configObj->mapserver->imageUrl))
- {
- $oImage->set("imagepath", $configObj->mapserver->imagePath);
- $oImage->set("imageurl", $configObj->mapserver->imageUrl);
- }
- $scaleObj->icons_url = $oImage->saveWebImage();
- $scaleObj->icons_width = $nIconWidth;
- $scaleObj->icons_height = $nIconHeight;
-
+ //set the image path and image dir based on what fusion config file
+ $configObj = $_SESSION['fusionConfig'];
+ if (isset($configObj->mapserver->imagePath) && isset($configObj->mapserver->imageUrl))
+ {
+ $oImage->set("imagepath", $configObj->mapserver->imagePath);
+ $oImage->set("imageurl", $configObj->mapserver->imageUrl);
+ }
+
+ $scaleObj->icons_url = $oImage->saveWebImage();
+ $scaleObj->icons_width = $nIconWidth;
+ $scaleObj->icons_height = $nIconHeight;
}
-
header('Content-type: text/x-json');
header('X-JSON: true');
More information about the fusion-commits
mailing list