[mapguide-users] Select an object in MapGuide 2.0.2

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Thu Sep 17 08:23:35 EDT 2009


Are you certain that the xml you use is correct?

Do you remember to refresh the map?

Regards, Kenneth Skovhede, GEOGRAF A/S



alba skrev:
> hi all,
>
> I use mapguide open source 2.0.2 on Windows XP and IIS
> I have to select an object after the extraction, but
> I tried in three different alternative ways but  doesn't work
> I use the following code.
> Anyone can help me? My work is stopped!
> thanks Alba
>
>
> //************************************
> var mapWidgetId = 'Map';
> var Fusion = window.top.Fusion;
> var mapWidget = Fusion.getWidgetById(mapWidgetId);
>
> function SelectFeature(){
> 	..............................	
> 	.............................
> 	    selectionXml = reqHandler.responseText;
>             sel=TrimString(selectionXml);
>
>            //-- first mode-----------
>              var map = GetParent().Fusion.getMapByName(mapName);
>              map.setSelection(sel, true, true);
>             //----------------
>
>            //-- second mode----------
>             GetParent().SetSelectionXML(sel);
>             //----------------
>
>            //-- third mode----------
>             mapWidget.setSelection(sel, z);
>             //----------------
>
>            alert(mapWidget.hasSelection());
>
>         }
>
> function SetSelectionXML(selectionXml) {
>     var Fusion = window.top.Fusion;
>     var mapWidget = Fusion.getWidgetById('Map');
>     if (mapWidget && mapWidget.isMapLoaded()) {
>         mapWidget.setSelection(selectionXml, true, true);
>     }
> }
>
>   function GetParent()
>   {
>     if(popup) {
>         return opener;
>     } else {
>         return parent.parent;
>     }
>   }
>
>  function TrimString(responseString)
>         {
>             responseString = responseString.replace( /^\s+/g, "" );
>             return responseString.replace( /\s+$/g, "" );
>         }
> //*************************************************
>   


More information about the mapguide-users mailing list