[mapguide-users] Running Search query from Task Pane in Fusion

lolob azzam_wahab at hotmail.com
Fri Mar 20 05:23:40 EDT 2009


Hello mapguide users,

I'm running MGOS 2.02 with Autodesk Studio 2009 and PHP. I created a basic
query to test inside Fusion.
It works fine in the basic layout. The problem with the Fusion is when I
select one of the search results,
it does not zoom. Below is the piece of code for query, I don't know how to
change it to make it works inside Fusion. 
I don't have any problem with sessionID,locale and mapname. Just how to make
it zoom and select, thats all.

Thanks.

//code begin
<script language="javascript">
<?php
...
.....
........
..........
...............
..................... 

     $layer = $map->GetLayers()->GetItem($layerName);
     $selection = new MgSelection($map);		    
     $selection->AddFeatures($layer, $featureReader, 0);
     $selectionXml = $selection->ToXml();
     //dump the XML out to a JAVASCRIPT variable	
     echo 'var theXML=\'' . $selectionXml . '\';';
     //use theXML in javascript to call Viewer Javascript Functions
   }
        catch (MgException $e)
        {
        echo $e->GetMessage();
        echo $e->GetDetails();
        }
		
?>


function zoomAndHighlight()
{
    // select objects in viewer
    parent.parent.mapFrame.SetSelectionXML(theXML);

    // zoom to selected item in viewer #10 
    parent.parent.ExecuteMapAction(10);
}

</script>
<body onLoad=ZoomAndHighlight() >
</body>

//code end
-- 
View this message in context: http://n2.nabble.com/Running-Search-query-from-Task-Pane-in-Fusion-tp1816354p2507831.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list