[mapguide-commits] r7702 - sandbox/jng/http304/Web/src/HttpHandler

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Jul 30 05:44:23 PDT 2013


Author: jng
Date: 2013-07-30 05:44:23 -0700 (Tue, 30 Jul 2013)
New Revision: 7702

Modified:
   sandbox/jng/http304/Web/src/HttpHandler/HttpGetTileImage.cpp
Log:
Check in v2.6.0 GETTILEIMAGE support. This is currently blowing up (MgInvalidStreamHeaderException) due to some strange quirk in MgTile deserialization that is boggling my mind at the moment.

Modified: sandbox/jng/http304/Web/src/HttpHandler/HttpGetTileImage.cpp
===================================================================
--- sandbox/jng/http304/Web/src/HttpHandler/HttpGetTileImage.cpp	2013-07-30 08:23:23 UTC (rev 7701)
+++ sandbox/jng/http304/Web/src/HttpHandler/HttpGetTileImage.cpp	2013-07-30 12:44:23 UTC (rev 7702)
@@ -51,7 +51,7 @@
         // Get the tile row index and convert to integer
         m_tileRow = MgUtil::StringToInt32(params->GetParameterValue(MgHttpResourceStrings::reqRenderingTileRow));
     }
-    else if (version == MG_API_VERSION(1,2,0))
+    else if (version == MG_API_VERSION(1,2,0) || version == MG_API_VERSION(2,6,0))
     {
         // Get the map name
         m_mapName = params->GetParameterValue(MgHttpResourceStrings::reqTileMapDefinition);
@@ -128,7 +128,20 @@
         // Set the result
         hResult->SetResultObject(tileImage, tileImage->GetMimeType());
     }
+    else if (version == MG_API_VERSION(2,6,0))
+    {
+        Ptr<MgResourceIdentifier> resId = new MgResourceIdentifier(m_mapName);
 
+        // Get Proxy Tile Service instance
+        Ptr<MgTileService> service = (MgTileService*)(CreateService(MgServiceType::TileService));
+
+        // Call the C++ API
+        Ptr<MgTile> tile = service->GetTileWithCreationDate(resId, m_baseMapLayerGroupName, m_tileCol, m_tileRow, m_scaleIndex);
+        Ptr<MgByteReader> tileImage = tile->GetImage();
+
+        // Set the result
+        hResult->SetResultObject(tileImage, tileImage->GetMimeType());
+    }
     MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetTileImage.Execute")
 }
 
@@ -144,7 +157,8 @@
     // There are multiple supported versions
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(1,0,0) &&
-        version != MG_API_VERSION(1,2,0))
+        version != MG_API_VERSION(1,2,0) &&
+        version != MG_API_VERSION(2,6,0))
     {
         throw new MgInvalidOperationVersionException(
         L"MgHttpGetTileImage.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);



More information about the mapguide-commits mailing list