[fusion-commits] r3039 - in sandbox/cms_refactor: layers/Generic widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Mon Jul 30 08:37:02 PDT 2018


Author: jng
Date: 2018-07-30 08:37:02 -0700 (Mon, 30 Jul 2018)
New Revision: 3039

Modified:
   sandbox/cms_refactor/layers/Generic/Generic.js
   sandbox/cms_refactor/widgets/BasemapSwitcher.js
Log:
Fix (incomplete) XYZ layer support.
 - If an XYZ base layer is found, read the tile URL from Map/Extension/Options/urls
 - Add XYZ layer support to the BasemapSwitcher widget. The name of the XYZ layer (Map/Extension/Options/name) is used as the label.

Modified: sandbox/cms_refactor/layers/Generic/Generic.js
===================================================================
--- sandbox/cms_refactor/layers/Generic/Generic.js	2018-07-26 15:02:28 UTC (rev 3038)
+++ sandbox/cms_refactor/layers/Generic/Generic.js	2018-07-30 15:37:02 UTC (rev 3039)
@@ -170,8 +170,8 @@
          case 'XYZ':
             this.oLayerOL = new OpenLayers.Layer[this.layerType](
                                   this.getMapName(), 
-                                  this.sMapResourceId, 
-                                  this.mapTag.layerOptions );
+                                  this.mapTag.layerOptions.urls, 
+                                  this.mapTag.layerOptions);
             break;
           default:
             this.oLayerOL = new OpenLayers.Layer[this.layerType](
@@ -178,7 +178,7 @@
                                   this.getMapName(), 
                                   this.sMapResourceId, 
                                   this.mapTag.layerParams, 
-                                  this.mapTag.layerOptions );
+                                  this.mapTag.layerOptions);
 
             break;
         }

Modified: sandbox/cms_refactor/widgets/BasemapSwitcher.js
===================================================================
--- sandbox/cms_refactor/widgets/BasemapSwitcher.js	2018-07-26 15:02:28 UTC (rev 3038)
+++ sandbox/cms_refactor/widgets/BasemapSwitcher.js	2018-07-30 15:37:02 UTC (rev 3039)
@@ -288,6 +288,16 @@
                         }
                     }
                     break;
+                case "XYZ":
+                    {
+                        var xyzName = map.mapTag.extension.Options[0].name[0];
+                        this.options[xyzName] = xyzName;
+                        this.baseMaps[xyzName] = map;
+                        // The first non-MapGuide basemap will be the default basemap
+                        if (!this.defaultBasemap) {
+                            this.defaultBasemap = xyzName;
+                        }
+                    }
                 default:
                     break;
             }



More information about the fusion-commits mailing list