[fusion-commits] r3043 - in trunk: . layers/Generic lib templates/mapguide widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Fri Aug 10 23:01:41 PDT 2018


Author: jng
Date: 2018-08-10 23:01:41 -0700 (Fri, 10 Aug 2018)
New Revision: 3043

Added:
   trunk/templates/mapguide/index.php
Modified:
   trunk/
   trunk/layers/Generic/Generic.js
   trunk/lib/ApplicationDefinition.js
   trunk/lib/fusion.js
   trunk/widgets/BasemapSwitcher.js
Log:
MapGuide RFC 167: Merged revision(s) 3034-3042 from sandbox/cms_refactor

Index: trunk
===================================================================
--- trunk	2018-08-02 11:36:37 UTC (rev 3042)
+++ trunk	2018-08-11 06:01:41 UTC (rev 3043)

Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
## -3,6 +3,7 ##
 /sandbox/adsk/2.6l:2911
 /sandbox/adsk/3.1n:2925-2927,2935,2987,2989,3007-3012
 /sandbox/adsk/3.2o:2969-2972,2974,2978-2984
+/sandbox/cms_refactor:3034-3042
 /sandbox/createruntimemap:2699-2708
 /sandbox/jxlib-3.0:1957-2248
 /sandbox/mgrfc158:2980-2991
Modified: trunk/layers/Generic/Generic.js
===================================================================
--- trunk/layers/Generic/Generic.js	2018-08-02 11:36:37 UTC (rev 3042)
+++ trunk/layers/Generic/Generic.js	2018-08-11 06:01:41 UTC (rev 3043)
@@ -153,23 +153,6 @@
                 type: this.mapTag.layerOptions.type
              });
              break;
-         case 'Yahoo':
-            switch (this.mapTag.layerOptions.type) {   //Yahoo is similar to google
-              case 'YAHOO_MAP_SAT':              //defined by YMap, not a string
-              case 'YAHOO_SAT':
-                this.mapTag.layerOptions.type = YAHOO_MAP_SAT;
-                break;
-              case 'YAHOO_MAP_HYB':
-              case 'YAHOO_HYB':
-                this.mapTag.layerOptions.type = YAHOO_MAP_HYB;
-                break;
-              case 'YAHOO_MAP_REG':
-              case "YAHOO_REG":
-              default:
-                this.mapTag.layerOptions.type = YAHOO_MAP_REG;
-                break;
-            }
-            break;
          case 'OpenStreetMap':
          case 'OSM':
             if (this.mapTag.layerOptions.type) {
@@ -180,13 +163,15 @@
             }
             break;
          case 'Stamen':
-            this.oLayerOL = new OpenLayers.Layer[this.layerType](this.mapTag.layerOptions.type);
+            var stt = this.mapTag.layerOptions.type;
+            var url = "http://tile.stamen.com/" + stt + "/${z}/${x}/${y}.png";
+            this.oLayerOL = new OpenLayers.Layer.XYZ("Stamen (" + stt + ")", url, this.mapTag.layerOptions);
             break;
          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](
@@ -193,7 +178,7 @@
                                   this.getMapName(), 
                                   this.sMapResourceId, 
                                   this.mapTag.layerParams, 
-                                  this.mapTag.layerOptions );
+                                  this.mapTag.layerOptions);
 
             break;
         }
@@ -200,11 +185,46 @@
        
         if (!this.oLayerOL) {
             if(this.layerType == 'OpenStreetMap' || this.layerType == 'OSM') {
+                var layerOpts = this.mapTag.layerOptions;
+                var osmLayerType = this.mapTag.layerOptions.type;
+                var urls = this.mapTag.layerOptions.urls;
                 //Test OSM sub-type before falling back to OpenLayers.Layer.OSM
-                if (typeof(OpenLayers.Layer.OSM[this.mapTag.layerOptions.type]) != 'undefined') { 
-                    this.oLayerOL = new OpenLayers.Layer.OSM[this.mapTag.layerOptions.type](this.getMapName(), null, this.mapTag.layerOptions );
+                if (osmLayerType != "Mapnik") {
+                    switch (osmLayerType) {
+                        case "CycleMap":
+                            if (!urls) {
+                                urls = [
+                                    "http://a.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
+                                    "http://b.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
+                                    "http://c.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png"
+                                ];
+                            }
+                            layerOpts = OpenLayers.Util.extend({
+                                numZoomLevels: 19,
+                                attribution: "© <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors, Tiles courtesy of <a href='http://www.opencyclemap.org'>Andy Allan</a>",
+                                buffer: 0,
+                                transitionEffect: "resize"
+                            }, layerOpts);
+                            break;
+                        case "TransportMap":
+                            if (!urls) {
+                                urls = [
+                                    "http://a.tile2.opencyclemap.org/transport/${z}/${x}/${y}.png",
+                                    "http://b.tile2.opencyclemap.org/transport/${z}/${x}/${y}.png",
+                                    "http://c.tile2.opencyclemap.org/transport/${z}/${x}/${y}.png"
+                                ];
+                            }
+                            layerOpts = OpenLayers.Util.extend({
+                                numZoomLevels: 19,
+                                attribution: "© <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors, Tiles courtesy of <a href='http://www.opencyclemap.org'>Andy Allan</a>",
+                                buffer: 0,
+                                transitionEffect: "resize"
+                            }, layerOpts);
+                            break;
+                    }
+                    this.oLayerOL = new OpenLayers.Layer.OSM("OpenStreetMap - " + osmLayerType, urls, layerOpts);
                 } else {
-                    this.oLayerOL = new OpenLayers.Layer.OSM(this.getMapName(), null, this.mapTag.layerOptions );
+                    this.oLayerOL = new OpenLayers.Layer.OSM(this.getMapName(), urls, layerOpts);
                 }
             }
             else {

Modified: trunk/lib/ApplicationDefinition.js
===================================================================
--- trunk/lib/ApplicationDefinition.js	2018-08-02 11:36:37 UTC (rev 3042)
+++ trunk/lib/ApplicationDefinition.js	2018-08-11 06:01:41 UTC (rev 3043)
@@ -509,27 +509,31 @@
         this.layerOptions = {};
         if (tagOptions && tagOptions[0]) {
           for (var key in tagOptions[0]) {
-            var val = tagOptions[0][key][0];
-            if (val.toFloat().toString() == val) {
-              this.layerOptions[key] = val.toFloat();
+            if (key == "urls") {
+                this.layerOptions[key] = tagOptions[0][key];
             } else {
-              if (val.toLowerCase() == 'true') {
-                this.layerOptions[key] = true;
-              } else if (val.toLowerCase() == 'false') {
-                this.layerOptions[key] = false;
-              } else {
-                this.layerOptions[key] = val;
-              }
+                var val = tagOptions[0][key][0];
+                if (val.toFloat().toString() == val) {
+                    this.layerOptions[key] = val.toFloat();
+                } else {
+                    if (val.toLowerCase() == 'true') {
+                        this.layerOptions[key] = true;
+                    } else if (val.toLowerCase() == 'false') {
+                        this.layerOptions[key] = false;
+                    } else {
+                        this.layerOptions[key] = val;
+                    }
+                }
+                if (key == 'maxExtent' || key == 'minExtent' || key == 'restrictedExtent') {
+                    this.layerOptions[key] = OpenLayers.Bounds.fromString(this.layerOptions[key]);
+                }
+                if (key == 'resolutions' || key == 'scales') {
+                    this.layerOptions[key] = this.layerOptions[key].split(',');
+                    for (var i=0; i<this.layerOptions[key].length; i++) {
+                        this.layerOptions[key][i] = this.layerOptions[key][i].toFloat();
+                    }
+                }
             }
-            if (key == 'maxExtent' || key == 'minExtent' || key == 'restrictedExtent') {
-              this.layerOptions[key] = OpenLayers.Bounds.fromString(this.layerOptions[key]);
-            }
-            if (key == 'resolutions' || key == 'scales') {
-              this.layerOptions[key] = this.layerOptions[key].split(',');
-              for (var i=0; i<this.layerOptions[key].length; i++) {
-                this.layerOptions[key][i] = this.layerOptions[key][i].toFloat();
-              }
-            }
           }
         }
         var tagParams = this.extension.Parameters;


Property changes on: trunk/lib/ApplicationDefinition.js
___________________________________________________________________
Modified: svn:mergeinfo
## -1,5 +1,6 ##
 /branches/fusion-mg24/lib/ApplicationDefinition.js:2560
 /sandbox/adsk/2.4j/lib/ApplicationDefinition.js:2486-2514
+/sandbox/cms_refactor/lib/ApplicationDefinition.js:3034-3042
 /sandbox/createruntimemap/lib/ApplicationDefinition.js:2699-2708
 /sandbox/jxlib-3.0/lib/ApplicationDefinition.js:1957-2248
 /sandbox/ol213/lib/ApplicationDefinition.js:2801-2803
Modified: trunk/lib/fusion.js
===================================================================
--- trunk/lib/fusion.js	2018-08-02 11:36:37 UTC (rev 3042)
+++ trunk/lib/fusion.js	2018-08-11 06:01:41 UTC (rev 3043)
@@ -344,15 +344,21 @@
             // Override the pre-created sessionId by user specified sessionId(if exist)
             this.sessionId = sessionIdParam || options.sessionId || this.sessionId;
         
-            if (options.applicationDefinitionURL) {
-                this.applicationDefinitionURL = options.applicationDefinitionURL;            
+            if (options.appDef) { //An appdef was alread loaded via the server-side entry point
+                this.newTemplatePath = true;
+                this.appDefJson = options.appDef;
+                this.applicationDefinitionURL = "ApplicationDefinition_Generated.xml";
             } else {
-                var queryAppDef = this.getQueryParam('ApplicationDefinition');
-                if (queryAppDef) {
-                    this.applicationDefinitionURL = queryAppDef.split('+').join(' ');
-                    this.appDefJson = null;   //wipe out any preloaded AppDef in a single file build
+                if (options.applicationDefinitionURL) {
+                    this.applicationDefinitionURL = options.applicationDefinitionURL;            
                 } else {
-                    this.applicationDefinitionURL = 'ApplicationDefinition.xml';
+                    var queryAppDef = this.getQueryParam('ApplicationDefinition');
+                    if (queryAppDef) {
+                        this.applicationDefinitionURL = queryAppDef.split('+').join(' ');
+                        this.appDefJson = null;   //wipe out any preloaded AppDef in a single file build
+                    } else {
+                        this.applicationDefinitionURL = 'ApplicationDefinition.xml';
+                    }
                 }
             }
             if (Fusion._singleFile) {
@@ -378,17 +384,78 @@
                 this.sRedirectScript = 'redirect.php';
                 configUrl += '&method=get';
             }
-        
-            if (Fusion.configuration) {
-                //config.json loaded via single file build
-                this.serverSet();
+
+            var onAppDefFetched = OpenLayers.Function.bind(function() {
+                if (Fusion.configuration) {
+                    //config.json loaded via single file build
+                    this.serverSet();
+                } else {
+                    var options = {
+                        onSuccess: OpenLayers.Function.bind(this.getConfigCB, this),
+                        onFailure: OpenLayers.Function.bind(this.serverFailed, this),
+                        method: 'get'
+                    };
+                    this.ajaxRequest(configUrl, options);
+                }
+            }, this);
+
+            var mapAgentUrl = getAgentUrl();
+            var bAlreadyInit = (this.newTemplatePath === true && this.appDefJson != null);
+            var appDefUrl = Fusion.getQueryParam('ApplicationDefinition'); 
+            if (!bAlreadyInit &&
+                appDefUrl && (
+                appDefUrl.indexOf('Library') == 0 ||
+                appDefUrl.indexOf('Session') == 0)) {
+                
+                var fetchAppDef = function(appDefUrl, sessionId) {
+                    var xhr = getXmlHttpRequest();
+                    xhr.open("GET", mapAgentUrl + "?OPERATION=GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGuide+Developer&RESOURCEID=" + appDefUrl + "&FORMAT=text%2Fxml&SESSION="+ sessionId, false); 
+                    try {
+                        xhr.send(null); 
+                        var appDefXML = xhr.responseXML.documentElement; 
+
+                        if (appDefXML) {
+                            var bingMapKeyElement = appDefXML.getElementsByTagName("BingMapKey")[0];
+                            if (bingMapKeyElement) {
+                                var bingMapKey = bingMapKeyElement.textContent;
+                                if (!bingMapKey)
+                                    bingMapKey = bingMapKeyElement.text;
+                                Fusion.bingMapKey = bingMapKey;
+                            }
+                            onAppDefFetched();
+                        }
+                    } catch (e) {
+                        if (xhr.statusText == "MgResourceNotFoundException") {
+                            alert("Failed to fetch Application Definition. The specified resource could not be found");
+                        } //Anything else we can't do anything about as TraceKit is probably not loaded yet
+                    }
+                };
+                
+                var getSiteVersion = function(sessionId) {
+                    var xhr = getXmlHttpRequest(); 
+                    var mapAgentUrl = getAgentUrl(); 
+                    xhr.open("GET", mapAgentUrl + "?OPERATION=GETSITEVERSION&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGuide+Developer&SESSION="+ sessionId, false); 
+                    xhr.send(null); 
+                    var verXML = xhr.responseXML.documentElement; 
+                    var el = verXML.getElementsByTagName("Version")[0];
+                    var version = el.textContent || el.text;
+                    var bits = version.split('.');
+                    return new Array(parseInt(bits[0]),
+                                    parseInt(bits[1]),
+                                    parseInt(bits[2]),
+                                    parseInt(bits[3]));
+                };
+                
+                var passedSessionId = Fusion.getQueryParam('Session'); 
+                if (passedSessionId == null || passedSessionId == "" ){
+                    createSessionId(Fusion.getQueryParam("Username"), Fusion.getQueryParam("Password"));
+                } else {
+                    Fusion.sessionId = passedSessionId;
+                    Fusion.siteVersion = getSiteVersion(passedSessionId);
+                }
+                fetchAppDef(appDefUrl, Fusion.sessionId);
             } else {
-                var options = {
-                    onSuccess: OpenLayers.Function.bind(this.getConfigCB, this),
-                    onFailure: OpenLayers.Function.bind(this.serverFailed, this),
-                    method: 'get'
-                };
-                this.ajaxRequest(configUrl, options);
+                onAppDefFetched();
             }
         },
     
@@ -641,8 +708,8 @@
          * r - {XMLHttpRequest} an XMLHttpRequest object
          */
         getConfigCB: function(r) {
-            if (r.responseText) {  
-                eval("this.configuration="+r.responseText);
+            if (r.responseText) { 
+                this.configuration = Fusion.parseJSON(r.responseText);
                 this.serverSet();
             } else {
                 //console.log('Error parsing configuration file, it is not valid somehow?');
@@ -1554,13 +1621,18 @@
             coreScripts.push('lib/OpenLayers/Lang/'+locale+'.js');
             coreScripts.push('text/'+locale+'.json');
         }
-        
-        var allScriptTags = new Array(coreScripts.length);
+
         for (var i = 0; i < coreScripts.length; i++) {
-            allScriptTags[i] = "<script src='" + host + coreScripts[i] +
-                                   "'></script>"; 
+            var script = document.createElement('script');
+            script.defer = false;
+            //Must load sequentially here as downstream scripts in this list rely on the previous scripts being
+            //loaded first
+            script.async = false;
+            script.type = "text/javascript";
+            script.id = coreScripts[i];
+            script.src = host + coreScripts[i];
+            document.getElementsByTagName('head')[0].appendChild(script);
         }
-        document.write(allScriptTags.join(""));
     }
     
     /*********************************************************************************/
@@ -1596,7 +1668,8 @@
         var xhr = getXmlHttpRequest(); 
         xhr.open("GET", fusionURL, false); 
         xhr.send(null); 
-    
+
+        //Can't use parseJSON as this JSON file will most likely have comments
         eval("Fusion.configuration=" + xhr.responseText); 
         var s = Fusion.configuration.mapguide.webTierUrl; 
         /* if it is set, use it ... otherwise assume fusion is installed in 
@@ -1653,87 +1726,28 @@
 				params += "&password=" + pass;
 			}
         }
-		xhr.open("POST", url, false);
-		xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-		xhr.setRequestHeader("Content-length", params.length);
-		xhr.setRequestHeader("Connection", "close");
-		xhr.send(params);
-		
-        var o = Fusion.parseJSON(xhr.responseText);
-        Fusion.sessionId = o.sessionId;
-        var version = o.siteVersion;
-        var bits = version.split('.');
-        Fusion.siteVersion = new Array(parseInt(bits[0]),
-                                       parseInt(bits[1]),
-                                       parseInt(bits[2]),
-                                       parseInt(bits[3])
-        );
-    }
-
-    var appDefUrl = Fusion.getQueryParam('ApplicationDefinition'); 
-    if (appDefUrl && (
-        appDefUrl.indexOf('Library') == 0 ||
-        appDefUrl.indexOf('Session') == 0)) {
-        
-        var fetchAppDef = function(appDefUrl, sessionId) {
-            var xhr = getXmlHttpRequest(); 
-            var mapAgentUrl = getAgentUrl(); 
-            xhr.open("GET", mapAgentUrl + "?OPERATION=GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGuide+Developer&RESOURCEID=" + appDefUrl + "&FORMAT=text%2Fxml&SESSION="+ sessionId, false); 
-            try {
-                xhr.send(null); 
-                var appDefXML = xhr.responseXML.documentElement; 
-
-                if (appDefXML) {
-                    var googleElement = appDefXML.getElementsByTagName("GoogleScript")[0]; 
-                    var yahooElement = appDefXML.getElementsByTagName("YahooScript")[0]; 
-                    var veElement = appDefXML.getElementsByTagName("VirtualEarthScript")[0];
-                    var osmElement = appDefXML.getElementsByTagName("OpenStreetMapScript")[0];
-                    var stamenElement = appDefXML.getElementsByTagName("StamenScript")[0];
-
-                    addElement(googleElement); 
-                    addElement(yahooElement); 
-                    addElement(veElement);
-                    addElement(osmElement);
-                    addElement(stamenElement);
-
-                    var bingMapKeyElement = appDefXML.getElementsByTagName("BingMapKey")[0];
-                    if (bingMapKeyElement) {
-                        var bingMapKey = bingMapKeyElement.textContent;
-                        if (!bingMapKey)
-                            bingMapKey = bingMapKeyElement.text;
-                        Fusion.bingMapKey = bingMapKey;
-                    }
+		xhr.open("POST", url, true);
+        xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+        xhr.onload = function (e) {
+            if (xhr.readyState === 4) {
+                if (xhr.status === 200) {
+                    var o = Fusion.parseJSON(xhr.responseText);
+                    Fusion.sessionId = o.sessionId;
+                    var version = o.siteVersion;
+                    var bits = version.split('.');
+                    Fusion.siteVersion = new Array(parseInt(bits[0]),
+                        parseInt(bits[1]),
+                        parseInt(bits[2]),
+                        parseInt(bits[3])
+                    );
+                } else {
+                    console.error(xhr.statusText);
                 }
-            } catch (e) {
-                if (xhr.statusText == "MgResourceNotFoundException") {
-                    alert("Failed to fetch Application Definition. The specified resource could not be found");
-                } //Anything else we can't do anything about as TraceKit is probably not loaded yet
             }
         };
-        
-        var getSiteVersion = function(sessionId) {
-            var xhr = getXmlHttpRequest(); 
-            var mapAgentUrl = getAgentUrl(); 
-            xhr.open("GET", mapAgentUrl + "?OPERATION=GETSITEVERSION&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGuide+Developer&SESSION="+ sessionId, false); 
-            xhr.send(null); 
-            var verXML = xhr.responseXML.documentElement; 
-            var el = verXML.getElementsByTagName("Version")[0];
-            var version = el.textContent || el.text;
-            var bits = version.split('.');
-            return new Array(parseInt(bits[0]),
-                             parseInt(bits[1]),
-                             parseInt(bits[2]),
-                             parseInt(bits[3]));
+        xhr.onerror = function (e) {
+            console.error(xhr.statusText);
         };
-        
-        var passedSessionId = Fusion.getQueryParam('Session'); 
-        if (passedSessionId == null || passedSessionId == "" ){
-            createSessionId(Fusion.getQueryParam("Username"), Fusion.getQueryParam("Password"));
-        } else {
-            Fusion.sessionId = passedSessionId;
-            Fusion.siteVersion = getSiteVersion(passedSessionId);
-        }
-        fetchAppDef(appDefUrl, Fusion.sessionId);
+        xhr.send(params);
     }
-    
 })();

Copied: trunk/templates/mapguide/index.php (from rev 3042, sandbox/cms_refactor/templates/mapguide/index.php)
===================================================================
--- trunk/templates/mapguide/index.php	                        (rev 0)
+++ trunk/templates/mapguide/index.php	2018-08-11 06:01:41 UTC (rev 3043)
@@ -0,0 +1,79 @@
+<?php
+
+require_once("../../layers/MapGuide/php/Common.php");
+require_once('../../common/php/Utilities.php');
+
+if (InitializationErrorOccurred())
+{
+    DisplayInitializationErrorHTML();
+    exit;
+}
+
+$locale = GetDefaultLocale();
+$params = $_GET;
+
+if (!array_key_exists("template", $params)) 
+{
+    echo "<p>Missing required parameter: template</p>";
+    exit;
+}
+if (!array_key_exists("ApplicationDefinition", $params)) 
+{
+    echo "<p>Missing required parameter: ApplicationDefinition</p>";
+    exit;
+}
+
+$bDebug = (array_key_exists("debug", $params) && $params["debug"] == "1");
+
+$templateName = strtolower($params["template"]);
+$appDef = $params["ApplicationDefinition"];
+$templatePath = dirname(__FILE__)."/$templateName/index.templ";
+
+if (!file_exists($templatePath)) {
+    echo "<p>Template ($templateName) not found</p>";
+    exit;
+}
+
+//Requests to this script can be made from anywhere, so disable XML entity loading to
+//guard against malicious XML
+libxml_disable_entity_loader(true);
+
+try {
+    $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
+    $appDefId = new MgResourceIdentifier($appDef);
+    $content = $resourceService->GetResourceContent($appDefId);
+
+    $document = new DOMDocument();
+    $document->loadXML($content->ToString());
+
+    $goog = $document->getElementsByTagName("GoogleScript");
+
+    $root = $document->documentElement;
+    $json = '{"' . $root->tagName . '":' . xml2json($root) . '}';
+
+    $scriptName = "fusionSF-compressed";
+    if ($bDebug) {
+        $scriptName = "fusion";
+    }
+
+    $content = file_get_contents($templatePath);
+
+    $content = str_replace("%__LIB_BASE__%", "../../lib", $content);
+    $content = str_replace("%__TEMPLATE_BASE__%", "$templateName", $content);
+    $content = str_replace("%__FUSION_SCRIPT__%", $scriptName, $content);
+    if ($goog->length == 1) {
+        $content = str_replace("%__SCRIPTS__%", '<script type="text/javascript" src="'.$goog->item(0)->textContent.'"></script>', $content);
+    } else { //Nothing to inject
+        $content = str_replace("%__SCRIPTS__%", "", $content);
+    }
+    $content = str_replace("%__APPDEF_JSON__%", $json, $content);
+
+    header("Content-Type: text/html");
+    echo $content;
+} catch (MgException $ex) {
+    $initializationErrorMessage = $ex->GetExceptionMessage();
+    $initializationErrorDetail = $ex->GetDetails();
+    $initializationErrorStackTrace = $ex->GetStackTrace();
+    DisplayInitializationErrorHTML();
+}
+?>
\ No newline at end of file

Modified: trunk/widgets/BasemapSwitcher.js
===================================================================
--- trunk/widgets/BasemapSwitcher.js	2018-08-02 11:36:37 UTC (rev 3042)
+++ trunk/widgets/BasemapSwitcher.js	2018-08-11 06:01:41 UTC (rev 3043)
@@ -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;
             }


Property changes on: trunk/widgets/BasemapSwitcher.js
___________________________________________________________________
Modified: svn:mergeinfo
## -1,5 +1,6 ##
 /branches/fusion-mg24/widgets/BasemapSwitcher.js:2560
 /sandbox/adsk/2.4j/widgets/BasemapSwitcher.js:2486-2526
+/sandbox/cms_refactor/widgets/BasemapSwitcher.js:3034-3042
 /sandbox/createruntimemap/widgets/BasemapSwitcher.js:2699-2708
 /sandbox/jxlib-3.0/widgets/BasemapSwitcher.js:1957-2248
 /sandbox/ol213/widgets/BasemapSwitcher.js:2801-2803


More information about the fusion-commits mailing list