[mapguide-users] mapAgentURL is not defined in FUSION mapguide

Rodolfo Moreno rodolfoamoreno at gmail.com
Mon Aug 5 06:38:11 PDT 2019


Thanks Liglio,
I made what you suggested.
_____________________________________________________
    var getSiteVersion = function(sessionId, callback) {
        var xhr = getXmlHttpRequest();  
*        var mapAgentUrl = getAgentUrl();*
        xhr.open("GET", mapAgentUrl +
"?OPERATION=GETSITEVERSION&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGuide+Developer&SESSION="+
sessionId, true);
__________________________________________________________

And now fusion is launched another error:

Error Details:
Uncaught TypeError: callback is not a function

Stack Trace:
 - ? at http://localhost/mapguide/fusion/lib/fusionSF.js (line: 1698)

here the code in that line:
__________________________________________________________
var getAgentUrl = function(callback) { 
        /* 
        * if the application has been loaded from the same host as 
        * fusion is installed in, then technically we don't need to 
        * use the redirect script because we conform to the  
        * Same Origin Policy for XmlHttpRequest to work. 
        */ 
        var fusionURL = Fusion._getScriptLocation(); 
        var testUrl = window.location.protocol + '//' +
window.location.host; 
        var configUrl = 'config.json'; 
    
        if (((Fusion.fusionURL.indexOf("http://") < 0) ||
(Fusion.fusionURL.indexOf(testUrl, 0) == 0)) && !(Fusion.bForceRedirect)) { 
            Fusion.sRedirectScript = ''; 
        } 
        else { 
            Fusion.sRedirectScript = 'redirect.php'; 
            configUrl += '&method=get'; 
        } 
    
        var r = Fusion.getRedirectScript(); 
        if (r != '') { 
            r = r + '?s='; 
        } 
    
        var fusionURL = r + Fusion.getFusionURL() + configUrl; 
    
        var xhr = getXmlHttpRequest(); 
        xhr.open("GET", fusionURL, true); 
        xhr.onload = function (e) {
            if (xhr.readyState === 4) {
                if (xhr.status === 200) {
                    //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 
                    * the default location and compute the web tier url from
that 
                    */ 
                    if (s) { 
                        var nLength = s.length; 
                        var slastChar = s.charAt((nLength - 1)); 
                        if (slastChar != '/') { 
                            s = s + "/"; 
                        } 
                    } else { 
                        var idx = Fusion.fusionURL.lastIndexOf('fusion'); 
                        if (idx == -1) { 
                            s = Fusion.fusionURL + "../";   //loaded
relatively from within fusion directory 
                        } 
                        else { 
                            s = Fusion.fusionURL.substring(0, idx); 
                        } 
                    } 
                    Fusion.configuration.mapguide.mapAgentUrl = s +
'mapagent/mapagent.fcgi'; 
*                    callback(Fusion.configuration.mapguide.mapAgentUrl);*
(LINE 1698)
                } else {
                    console.error(xhr.statusText);
                }
            }
        };
        xhr.onerror = function (e) {
            console.error(xhr.statusText);
        };
        xhr.send(null); 
    }
___________________________________________________________________

what could be the problem?





--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html


More information about the mapguide-users mailing list