Discussion:
[mapguide-users] Map Switch, Base Layer groups issue
madhurchanana
2018-01-02 08:46:34 UTC
Permalink
Hi ,

I have created a fusion application with three map definitions, with two of
them containing Base Layer groups. When i switch map from a map definition
not containing base layer groups, it is able to hide all the current active
layers and switch to the other map definition.But when i switch from a map
definition containing Base Layer groups having any layer active, the layer
gets attached to the Openlayers layer below and becomes the new base layer
for the next map.

I want my Base Layers to automatically get unchecked when i switch my maps.
It works fine if all the layers are inactive and i change maps. how can i do
it by coding or making changes in existent code in MapMenu.js.


Thanks
Madhur



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
RenoSun
2018-01-04 19:20:47 UTC
Permalink
Hi madhurchanana,

I think we have similar discussion about this issue before...but seems we
all just work around the issue to achieve our goal...

http://osgeo-org.1560.x6.nabble.com/Problems-with-base-layers-td5298092.html#a5300545

I may spend sometime look into codes...when I am not so busy.

I hope someone may provide the solution for this issue one day.




--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
madhurchanana
2018-01-08 03:38:36 UTC
Permalink
Hi RenoSun,

Thanks for the reply. In the discussion in the link, you mentioned you found
a way around using iframes by keeping one map in one fusion application. Can
you please tell how you achieved it and how you maintained the extents for
two maps to be the same.

Thanks
Madhur



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
RenoSun
2018-01-09 20:12:39 UTC
Permalink
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
madhurchanana
2018-01-24 10:59:57 UTC
Permalink
Sorry for reverting back late, i will give these codes a try.

Thanks a lot..



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