[mapguide-commits] r5318 - in trunk/MgDev/Web/src: mapviewerjava mapviewernet mapviewerphp

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Oct 21 10:49:18 EDT 2010


Author: jng
Date: 2010-10-21 07:49:18 -0700 (Thu, 21 Oct 2010)
New Revision: 5318

Modified:
   trunk/MgDev/Web/src/mapviewerjava/getselectedfeatures.jsp
   trunk/MgDev/Web/src/mapviewernet/getselectedfeatures.aspx
   trunk/MgDev/Web/src/mapviewerphp/getselectedfeatures.php
Log:
Fix #1474: Force dot decimal separator for zoom x/y values regardless of language settings on the host. .net patch provided by Gunter Becker. PHP and Java versions provided by me.

Modified: trunk/MgDev/Web/src/mapviewerjava/getselectedfeatures.jsp
===================================================================
--- trunk/MgDev/Web/src/mapviewerjava/getselectedfeatures.jsp	2010-10-21 14:36:42 UTC (rev 5317)
+++ trunk/MgDev/Web/src/mapviewerjava/getselectedfeatures.jsp	2010-10-21 14:49:18 UTC (rev 5318)
@@ -290,7 +290,7 @@
                 if (feat.Zoom == null)
                     sb.append("null");
                 else
-                    sb.append("{\"x\" : " + feat.Zoom.X + ", \"y\" : " + feat.Zoom.Y + "}");
+                    sb.append(String.format(Locale.ROOT, "{\"x\" : %f, \"y\" : %f }", feat.Zoom.X, feat.Zoom.Y));
                 //end zoom
                 //end feature
                 sb.append("}");

Modified: trunk/MgDev/Web/src/mapviewernet/getselectedfeatures.aspx
===================================================================
--- trunk/MgDev/Web/src/mapviewernet/getselectedfeatures.aspx	2010-10-21 14:36:42 UTC (rev 5317)
+++ trunk/MgDev/Web/src/mapviewernet/getselectedfeatures.aspx	2010-10-21 14:49:18 UTC (rev 5318)
@@ -228,7 +228,7 @@
                 if (feat.Zoom == null)
                     sb.Append("null");
                 else
-                    sb.Append("{\"x\" : " + feat.Zoom.X + ", \"y\" : " + feat.Zoom.Y + "}");
+                    sb.Append("{" + String.Format(CultureInfo.InvariantCulture, "\"x\" : {0}, \"y\" : {1} ", feat.Zoom.X, feat.Zoom.Y) + "}");
                 //end zoom
                 //end feature
                 sb.Append("}");

Modified: trunk/MgDev/Web/src/mapviewerphp/getselectedfeatures.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/getselectedfeatures.php	2010-10-21 14:36:42 UTC (rev 5317)
+++ trunk/MgDev/Web/src/mapviewerphp/getselectedfeatures.php	2010-10-21 14:49:18 UTC (rev 5318)
@@ -316,7 +316,11 @@
                     }
                     //Add JSONified feature
                     if($feat->zoom != null)
-                        array_push($totalFeaturesOnLayer, "{\"values\" : [".join(",", $featureProperties)."], \"zoom\" : { \"x\": ".$feat->zoom->x.", \"y\": ".$feat->zoom->y." } }");
+                    {
+                        $xstr = number_format($feat->zoom->x, 8, '.','');
+                        $ystr = number_format($feat->zoom->y, 8, '.','');
+                        array_push($totalFeaturesOnLayer, "{\"values\" : [".join(",", $featureProperties)."], \"zoom\" : { \"x\": $xstr, \"y\": $ystr } }");
+                    }
                     else
                         array_push($totalFeaturesOnLayer, "{\"values\" : [".join(",", $featureProperties)."], \"zoom\" : null }");
 



More information about the mapguide-commits mailing list