[mapguide-users] Re: Show Multiple Properties for selection

Jamo adam.jamison at portbris.com.au
Tue May 4 02:38:48 EDT 2010


I ahve been achieving this by replacing the properties panel in the ajax
viewer with my own.... this way I can check what layer a feature is on and
redirect it to be displayed a certain way....

It is hard for me to paste code here to show exact steps as it is very much
per layer based ...

I will try :-)

1. find a way to replace the properties panel
I do this in the taskpane frame

var initTimer;
var viewer;
function onLoad(){initTimer = serInterval(DelayedInit,200);}
//check to make sure map has loaded
function DelayedInit()
{
try
{
viewer = parent.parent.mapFrame // your mapFrame object
of(viewer.mapInit)
{
clearInterval(initTimer);
setPropertyPage();
}
}
catch(e) {alert(2.description);}
}

function setPropertPage()
{
var propertyCtrl = viewer.document.getElementById("PropertyCtrl");
if (propertyCtrl.src ==
"/mapguide2010/mapviewerajax/propertyctrl.php?LOCALE=en") {
propertyCtrl.src = "../propLoader/Default.aspx";}; // link to your new
properties panel :)
}

just run onLoad on html body load.

2. use the new properties panel as defined by you to show infromation the
way you want


//default functions for mapguide.
function SetProperties(count, properties) {
// this is where i send the selection to a hidden field and run some
postback code on an updatepanel
document.getElementById("selXML").value = parent.GetSelectionXML();
__doPostBack("InfoPanel1","");
}
function sendXML(XML) {
parent.parent.mapFrame.SetSelection(XML);
parent.parent.ExectureMapAction(10);
}

function onLoad() {
//fill some hidden fields with sessionId and mapName
        document.getElementById("sessionId").value = parent.GetSessionId();
        document.getElementById("mapName").value = parent.GetMapName();
    }


It gets tricky and hard for an beginner to explain from here but after
triggering the postback on the updatepanel I then grab the selectionXML and
do with it what I please in codebehind:),
run sql commands, display images, link to other systems, link to other
features etc etc.

I find what layer the selection is on and redirect it to display the
information, or if it isn't in a layer I have made one for yet I simply
throw it back to the properties panel in much the same way as the default
ajax page.

I also do some stuff to display multiple selections across multiple layers
and hold previous selection etc etc...

I'll see if I can clean it up and make it generic and post it back to the
community.
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Show-Multiple-Properties-for-selection-tp1819403p5001954.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list