[mapguide-commits] r9553 - in sandbox/jng/tiling_v3: Doc/samples Server/src/Services/Tile Web/src/localized Web/src/mapviewerjava Web/src/mapviewernet Web/src/mapviewerphp

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Jun 17 06:10:46 PDT 2019


Author: jng
Date: 2019-06-17 06:10:46 -0700 (Mon, 17 Jun 2019)
New Revision: 9553

Modified:
   sandbox/jng/tiling_v3/Doc/samples/samples.php
   sandbox/jng/tiling_v3/Server/src/Services/Tile/TileCacheXYZProvider.cpp
   sandbox/jng/tiling_v3/Web/src/localized/en
   sandbox/jng/tiling_v3/Web/src/mapviewerjava/mapframe.jsp
   sandbox/jng/tiling_v3/Web/src/mapviewernet/mapframe.aspx
   sandbox/jng/tiling_v3/Web/src/mapviewerphp/mapframe.php
Log:
- Have the AJAX viewer throw if attempting to load a map that links to an XYZ tile set (we don't support this)
- Fix tile width/height reporting for XYZ provider when retina scale is involved.
- Update samples landing page to link to new XYZ and hybrid samples

Modified: sandbox/jng/tiling_v3/Doc/samples/samples.php
===================================================================
--- sandbox/jng/tiling_v3/Doc/samples/samples.php	2019-06-17 12:21:35 UTC (rev 9552)
+++ sandbox/jng/tiling_v3/Doc/samples/samples.php	2019-06-17 13:10:46 UTC (rev 9553)
@@ -123,6 +123,8 @@
                 </ul>
                 <p class="sample-header">MapGuide with <a href="http://www.openlayers.org">OpenLayers</a></p>
                 <ul>
+                    <li><a href="ol2samples/hybrid/index.html">Open any map or tile set</a></li>
+                    <li><a href="ol2samples/xyz/index_ol.html">Sheboygan map as XYZ layer</a></li>
                     <li><a href="ol2samples/utfgrid/index.html">Sheboygan map as XYZ layer with UTFGrid interaction tiles</a></li>
                 </ul>
                 <? } ?>

Modified: sandbox/jng/tiling_v3/Server/src/Services/Tile/TileCacheXYZProvider.cpp
===================================================================
--- sandbox/jng/tiling_v3/Server/src/Services/Tile/TileCacheXYZProvider.cpp	2019-06-17 12:21:35 UTC (rev 9552)
+++ sandbox/jng/tiling_v3/Server/src/Services/Tile/TileCacheXYZProvider.cpp	2019-06-17 13:10:46 UTC (rev 9553)
@@ -113,12 +113,12 @@
 
 INT32 MgTileCacheXYZProvider::GetDefaultTileSizeX()
 {
-    return 256; //Always
+    return 256 * m_retinaScale;
 }
 
 INT32 MgTileCacheXYZProvider::GetDefaultTileSizeY()
 {
-    return 256; //Always
+    return 256 * m_retinaScale;
 }
 
 STRING MgTileCacheXYZProvider::GetTileFormat()

Modified: sandbox/jng/tiling_v3/Web/src/localized/en
===================================================================
--- sandbox/jng/tiling_v3/Web/src/localized/en	2019-06-17 12:21:35 UTC (rev 9552)
+++ sandbox/jng/tiling_v3/Web/src/localized/en	2019-06-17 13:10:46 UTC (rev 9553)
@@ -276,3 +276,6 @@
 # Multiple Property Processing
 SERVERERROR             = Server Error
 ERRORSTACKTRACE         = Stack Trace
+
+# Unsupported tile set
+ERR_UNSUPPORTED_TILESET = Unsupported tile set provider: {0}
\ No newline at end of file

Modified: sandbox/jng/tiling_v3/Web/src/mapviewerjava/mapframe.jsp
===================================================================
--- sandbox/jng/tiling_v3/Web/src/mapviewerjava/mapframe.jsp	2019-06-17 12:21:35 UTC (rev 9552)
+++ sandbox/jng/tiling_v3/Web/src/mapviewerjava/mapframe.jsp	2019-06-17 13:10:46 UTC (rev 9553)
@@ -75,6 +75,11 @@
     int tileSizeY = tileSrvc.GetDefaultTileSizeY();
     if (null != tileSetId)
     {
+        //Can't load map if it points to a non-default tile set provider
+        if (map.GetTileSetProvider() != "Default")
+        {
+            throw new RuntimeException(MessageFormat.format(MgLocalizer.GetString("ERR_UNSUPPORTED_TILESET", locale), new Object[] { map.GetTileSetProvider() }));
+        }
         //Overwrite the map definition with tile set id (this is for GETTILE requests) and
         //use size settings from that tile set
         mapDefinition = tileSetId.ToString();

Modified: sandbox/jng/tiling_v3/Web/src/mapviewernet/mapframe.aspx
===================================================================
--- sandbox/jng/tiling_v3/Web/src/mapviewernet/mapframe.aspx	2019-06-17 12:21:35 UTC (rev 9552)
+++ sandbox/jng/tiling_v3/Web/src/mapviewernet/mapframe.aspx	2019-06-17 13:10:46 UTC (rev 9553)
@@ -78,6 +78,11 @@
         int tileSizeY = tileSrvc.GetDefaultTileSizeY();
         if (null != tileSetId)
         {
+            //Can't load map if it points to a non-default tile set provider
+            if (map.GetTileSetProvider() != "Default")
+            {
+                throw new Exception(String.Format(MgLocalizer.GetString("ERR_UNSUPPORTED_TILESET", locale), new Object[] { map.GetTileSetProvider() }));
+            }
             //Overwrite the map definition with tile set id (this is for GETTILE requests) and
             //use size settings from that tile set
             mapDefinition = tileSetId.ToString();

Modified: sandbox/jng/tiling_v3/Web/src/mapviewerphp/mapframe.php
===================================================================
--- sandbox/jng/tiling_v3/Web/src/mapviewerphp/mapframe.php	2019-06-17 12:21:35 UTC (rev 9552)
+++ sandbox/jng/tiling_v3/Web/src/mapviewerphp/mapframe.php	2019-06-17 13:10:46 UTC (rev 9553)
@@ -68,6 +68,11 @@
     $tileSizeY = $tileSrvc->GetDefaultTileSizeY();
     if (NULL != $tileSetId)
     {
+        //Can't load map if it points to a non-default tile set provider
+        if ($map->GetTileSetProvider() != "Default")
+        {
+            throw new Exception(FormatMessage("ERR_UNSUPPORTED_TILESET", $locale, array($map->GetTileSetProvider())));
+        }
         //Overwrite the map definition with tile set id (this is for GETTILE requests) and
         //use size settings from that tile set
         $mapDefinition = $tileSetId->ToString();
@@ -152,6 +157,11 @@
     $errorMsg = EscapeForHtml($e->GetDetails());
     echo $errorMsg;
 }
+catch(Exception $e)
+{
+    $errorMsg = EscapeForHtml($e->getMessage());
+    echo $errorMsg;
+}
 
 //load ajax template code and format it
 function GetParameters($params)



More information about the mapguide-commits mailing list