[mapguide-commits] r6432 - in branches/maestro-4.0.x: MaestroAPITests OSGeo.MapGuide.MaestroAPI/Mapping

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Jan 16 08:34:47 EST 2012


Author: jng
Date: 2012-01-16 05:34:47 -0800 (Mon, 16 Jan 2012)
New Revision: 6432

Modified:
   branches/maestro-4.0.x/MaestroAPITests/RuntimeMapTests.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
Log:
#1916: Fix incorrect map extent serialization. Includes unit test

Modified: branches/maestro-4.0.x/MaestroAPITests/RuntimeMapTests.cs
===================================================================
--- branches/maestro-4.0.x/MaestroAPITests/RuntimeMapTests.cs	2012-01-16 09:26:03 UTC (rev 6431)
+++ branches/maestro-4.0.x/MaestroAPITests/RuntimeMapTests.cs	2012-01-16 13:34:47 UTC (rev 6432)
@@ -111,6 +111,26 @@
 
         protected abstract IServerConnection CreateTestConnection();
 
+        public virtual void TestExtentSerialization()
+        {
+            var resSvc = _conn.ResourceService;
+            var mdf = resSvc.GetResource("Library://UnitTests/Maps/Sheboygan.MapDefinition") as IMapDefinition;
+            Assert.NotNull(mdf);
+            mdf.Extents = ObjectFactory.CreateEnvelope(1.0, 2.0, 3.0, 4.0);
+
+            var mapSvc = _conn.GetService((int)ServiceType.Mapping) as IMappingService;
+            Assert.NotNull(mapSvc);
+
+            var map = mapSvc.CreateMap("Session:" + _conn.SessionID + "//TestExtentSerialization.Map", mdf, 1.0);
+            map.Save();
+
+            var map2 = mapSvc.OpenMap("Session:" + _conn.SessionID + "//TestExtentSerialization.Map");
+            Assert.AreEqual(1.0, map2.DataExtent.MinX);
+            Assert.AreEqual(2.0, map2.DataExtent.MinY);
+            Assert.AreEqual(3.0, map2.DataExtent.MaxX);
+            Assert.AreEqual(4.0, map2.DataExtent.MaxY);
+        }
+
         public virtual void TestCreate()
         {
             //Create a runtime map from its map definition, verify layer/group
@@ -1045,6 +1065,12 @@
         {
             return ConnectionUtil.CreateTestHttpConnection();
         }
+
+        [Test]
+        public override void TestExtentSerialization()
+        {
+            base.TestExtentSerialization();
+        }
         
         [Test]
         public override void TestResourceEvents()
@@ -1131,6 +1157,12 @@
         }
 
         [Test]
+        public override void TestExtentSerialization()
+        {
+            base.TestExtentSerialization();
+        }
+
+        [Test]
         public override void TestResourceEvents()
         {
             base.TestResourceEvents();

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs	2012-01-16 09:26:03 UTC (rev 6431)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs	2012-01-16 13:34:47 UTC (rev 6432)
@@ -684,8 +684,8 @@
 
             s.Write(env.MinX);
             s.Write(env.MinY);
+            s.Write(env.MaxX);
             s.Write(env.MaxY);
-            s.Write(env.MaxY);
         }
 
         private Dictionary<string, ChangeList> m_changeList;



More information about the mapguide-commits mailing list