I find that to be difficult at first.
In the javascript you only have an Xml that contains
<FeatureSet>
 <Layer id="guid>
   <Class id="schema">
      <ID>base64encoded_id</ID>
  </Class>
 </Layer>
</FeatureSet>

The can be multiple layers, multiple class and multiple ID entries.
With this info, you must query the runtime map to find the layer(s) with the corresponding Guid. Then you must query the layer's featuresource to retrive the rows and columns corresponding to the given ID's for the schema.
The result is the data for the selected features.

Another way to do it, is used in the standard viewer:
C:\Program Files\MapGuideOpenSource2.0\WebServerExtensions\www\mapviewernet\

Basically you have the following procedure:
function SetSelection(selText, requery)
{
var reqParams = "SESSION=" + sessionId + "&MAPNAME=" + encodeURIComponent(mapName) + "&SEQ=" + Math.random() + "&SELECTION=" + encodeURIComponent(selText) + "&QUERYINFO=" + (requery? "1": "0");
   reqHandler = CreateRequestHandler();
   reqHandler.open("POST", setSelScript, false);
reqHandler.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   reqHandler.send(reqParams);
   if(requery)
       return reqHandler.responseXML;
}

The selText is the selection xml, and if requery is set, the return value should contain the info you are looking for.

Regards, Kenneth Skovhede, GEOGRAF A/S



Nick Aizen skrev:

Can anyone explain the best way to display the properties or information that refers to the currently selected item in the viewer programmatically?

Thanks,

*Nick Aizen*

------------------------------------------------------------------------

_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Reply via email to