[mapguide-users] Show/Hide Layers and properties pane programmatically

andrea tiveron - metodi srl andrea.tiveron at e-metodi.it
Mon Nov 12 13:22:14 EST 2007


 
I add an Invoke Script Command with this code:

if(parent.frames[1].document.getElementById("InfoBand").style.width ==
'0px')
{
parent.frames[1].minInfoWidth=20;
parent.frames[1].ResizeTo(200);
parent.frames[1].InitialMapView();
}
    else
{
parent.frames[1].minInfoWidth=0;
parent.frames[1].ResizeTo(0);
parent.frames[1].document.getElementById("LayerCaption").style.width = 0;
parent.frames[1].document.getElementById("LegendCtrl").style.width = 0;
parent.frames[1].document.getElementById("PropertyCaption").style.width = 0;
parent.frames[1].document.getElementById("PropertyCtrl").style.width = 0;
parent.frames[1].InitialMapView();
}

not very elegant but it works

andrea
 
-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Willem Schwarte
Sent: Monday, March 19, 2007 10:02 AM
To: MapGuide Users Mail List
Subject: RE: [mapguide-users] Show/Hide Layers and
propertiespaneprogrammatically

Hi Maciek,

Did you happen to solve this problem of hiding/showing the legend pane?

Willem




-----Oorspronkelijk bericht-----
Van: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] Namens Maciej Skorczewski
Verzonden: donderdag 15 maart 2007 13:54
Aan: MapGuide Users Mail List
Onderwerp: Re: [mapguide-users] Show/Hide Layers and propertiespane
programmatically


> Sorry for the trouble again!! :-)
> Do we have to define  the code for getIFrameDocument()? Or is it an 
> existing method? I keep getting an error for that method. Also, is 
> ifrMap the name of ur frame in the main page like 
> ajaxtiledviewersample.js in the javaviewersample aplication?

this i my function.


function getIFrameDocument(aID){
  var rv = null;

  // if contentDocument exists, W3C compliant (Mozilla)
  if (top.document.getElementById(aID).contentDocument){
    rv = top.document.getElementById(aID).contentDocument;
  } else {
    // IE
    rv = top.document.frames[aID].document;
  }


maciek.

_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users



More information about the mapguide-users mailing list