[mapguide-users] Map Switch, Base Layer groups issue

RenoSun renolionheart at gmail.com
Tue Jan 9 12:12:39 PST 2018


Firstly, I am using Fusion turquoiseyellow template using fusionSF.js. 

I modified index.html, and fusionSF.js to achieve my goal.

Under  
window.onload = function () {
            //if it is first time load fusion
            Fusion.initializeLocale();  //need to call this first if
String.Translate is to be used in the onload
....
//add this function to update URL parameter
 function getParamFromTop(sname) {
            //var params =
location.search.substr(location.search.indexOf("?") + 1);
            var params =
window.top.location.search.substr(window.top.location.search.indexOf("?") +
1);
            var sval = "";
            //console.log("test");
            params = params.split("&");
            // split param and value into individual pieces
            for (var i = 0; i < params.length; i++) {
                temp = params[i].split("=");
                if ([temp[0]] == sname) { sval = temp[1]; }
            }
            return sval;
}

....
var initPanelHandler = function () {
 if (isTaskPaneRegistered) return;
...
//add these code under initPanelHandler...
if (getParamFromTop('curextent') != '' && getParamFromTop('curextent') !=
null && getParamFromTop('first') == 1) {
                var ext = getParamFromTop('curextent').split(',');
                //console.log(ext);
                ext = new OpenLayers.Bounds(ext[0], ext[1], ext[2], ext[3]);
                mapWidget.setExtents(ext);
                //console.log("setExt");
}
else {
       setGetParameter("first", "1");
}
mapWidget.registerForEvent(Fusion.Event.MAP_EXTENTS_CHANGED,
rememberedExtent);
...






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


More information about the mapguide-users mailing list