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

Farah farah at egovernments.org
Thu Mar 15 08:01:40 EDT 2007


Hi Maciej,

Also, what does the method: getIFrameDocument do?



Thanks 
farah

-----Original Message-----
From: Farah [mailto:farah at egovernments.org] 
Sent: Thursday, March 15, 2007 5:20 PM
To: 'MapGuide Users Mail List'
Subject: RE: [mapguide-users] Show/Hide Layers and propertiespane
programmatically

Hi Maciej,

Thanks a lot for that! :-)
Just one clarification though. In the javascript function you are calling:
getIFrameDocument('ifrMap'). What does 'ifrMap' denote here?


Regards
Farah

-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Maciej
Skorczewski
Sent: Thursday, March 15, 2007 5:02 PM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] Show/Hide Layers and propertiespane
programmatically

Hi Farah

i make show/hide TaskArea (right menu), i thing that can help you.

Solution

1. edit files framesetnotaskbar.templ and add this

---
<frameset name="maparea" cols="*,%s,0,0" frameborder=0 border=0 
id='hide_show'>
---

after change....


<frameset rows="%s,*,%s" frameborder=0 border=0>
     <frame name="tbFrame" %s noresize scrolling=no>
     <frameset name="maparea" cols="*,%s,0,0" frameborder=0 border=0 
id='hide_show'>
         <frame name="mapFrame" 
src="%s?MAPDEFINITION=%s&TYPE=%s&SHOWLEGEND=%s&SHOWPROP=%s&INFOWIDTH=%s&LOCA
LE=%s&HLTGT=%s&HLTGTNAME=%s&SHOWSLIDER=%s%s" 
noresize scrolling=no>
         <frame name="taskFrame" %s noresize frameborder=1 border=1 
scrolling=no>
         <frame name="formFrame" noresize src="%s">
         <frame name="scriptFrame" noresize>
     </frameset>
     <frame name="sbFrame" %s noresize scrolling=no>
</frameset>



ok so now you add id to frame and you can call this frame by 
onclick="javascript:show_hide_right_layer();">


----- function body-------

function show_hide_right_layer()
{
GetParent().EndMeasure();
getIFrameDocument('ifrMap').getElementById('hide_show').cols="*,0,0,0";
}


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;
  }

  return rv;
   }

----- function body-------





in studio add new invoke script and i body put

----- function body-------
function show_hide_right_layer()
{
getIFrameDocument('ifrMap').getElementById('hide_show').cols="*,200,0,0";
}

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;
  }
  return rv;
   }



show_hide_right_layer();
----- function body-------




maciek




> I need to toggle the visibility of the layers+properties pane, 
> programmatically,  at the click of a button. How do I go about doing 
> this? Also, is there a way to do the same functionality for the map as 
> well? Is it possible to turn off the map programmatically?

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

Disclaimer by Mail Administrator - Yukthi


More information about the mapguide-users mailing list