Running Search query from Task Pane in Fusion

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Running Search query from Task Pane in Fusion

max_samart
Hi All,
          I am trying to migrate my application onto fusion(MGOS2.0.1) although  i managed to add maps and other basic functions ,overview map etc but i like to add my different customized search code into the fusion task pane which use to perform search and then return results in the same task pane and when i click on zoom icon, it use to select the feature and returns the info of the feature (Its working in the MGOS2.0.1 but i don't know how to get going into the Fusion-I tried adding the task in the task pane same as MapGuide Open Source and gave the path for the query file but it use to show file not found error).
 
Thks
Max !!



_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Running Search query from Task Pane in Fusion

xjimmyshcn
1)install mapguide studio 2009, then you can create flexible weblayout. it's for fusion.
 note: you can't use base layer in map.

2)the map.open(map_name) might occrue error. the map_name is not the same as traditional method(not use fusion),suppose the map name is asiamap , in fusion it looks like asiamap_fusion4845627ed9705.

3)the parent.parent.mapFrame might occrue error. but you can use
parent.document.getElementById('Map').

4)parent.parent.mapFrame.Refresh() cann't be used, you can use window.top.Fusion.getWidgetById('Map').drawMap()  to refresh map.

5)if you want to select feature,you should do:
at server, after selection.ToXml() ,you should add the follow line:
              selection.Save(resService, map_name);
at client, use   window.top.Fusion.getWidgetById('Map').drawMap()   to refresh the map.


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


max_samart wrote
Hi All,
          I am trying to migrate my application onto fusion(MGOS2.0.1) although  i managed to add maps and other basic functions ,overview map etc but i like to add my different customized search code into the fusion task pane which use to perform search and then return results in the same task pane and when i click on zoom icon, it use to select the feature and returns the info of the feature (Its working in the MGOS2.0.1 but i don't know how to get going into the Fusion-I tried adding the task in the task pane same as MapGuide Open Source and gave the path for the query file but it use to show file not found error).
Thks
Max !!



_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

In addition: about the url parameters in fusion

xjimmyshcn
In addition,
in traditional method(not use fusion) ,the page in Task Pane would receive 1 Form parameters:
,that's SESSION, request method:

String sessionId = Request.Form.Get("SESSION");

in fusion, there is 3 default URL parameters:
 LOCALE,SESSION and MAPNAME. request method:
    String locale= Request.QueryString.Get("LOCALE").Split(',')[0];
    String sessionId = Request.QueryString.Get("SESSION").Split(',')[0];
    String mapName = Request.QueryString.Get("MAPNAME").Split(',')[0];


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


foolfish wrote
1)install mapguide studio 2009, then you can create flexible weblayout. it's for fusion.
 note: you can't use base layer in map.

2)the map.open(map_name) might occrue error. the map_name is not the same as traditional method(not use fusion),suppose the map name is asiamap , in fusion it looks like asiamap_fusion4845627ed9705.

3)the parent.parent.mapFrame might occrue error. but you can use
parent.document.getElementById('Map').

4)parent.parent.mapFrame.Refresh() cann't be used, you can use window.top.Fusion.getWidgetById('Map').drawMap()  to refresh map.

5)if you want to select feature,you should do:
at server, after selection.ToXml() ,you should add the follow line:
              selection.Save(resService, map_name);
at client, use   window.top.Fusion.getWidgetById('Map').drawMap()   to refresh the map.


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


max_samart wrote
Hi All,
          I am trying to migrate my application onto fusion(MGOS2.0.1) although  i managed to add maps and other basic functions ,overview map etc but i like to add my different customized search code into the fusion task pane which use to perform search and then return results in the same task pane and when i click on zoom icon, it use to select the feature and returns the info of the feature (Its working in the MGOS2.0.1 but i don't know how to get going into the Fusion-I tried adding the task in the task pane same as MapGuide Open Source and gave the path for the query file but it use to show file not found error).
Thks
Max !!



_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Running Search query from Task Pane in Fusion

max_samart
In reply to this post by max_samart

Hi,

                  Thanks for Lot of Details let me go through and try the steps to see how i can migarate the same application on Fusion+MapGuide.I have some more questions reagrding the same:

 

1. How to find the fusion name-like xyz_fusion4845627ed9705

 

2. Can you elaborate little bit more on the below-->
 
At server(? Path), after selection.ToXml() ,you should add the follow line:
selection.Save(resService, map_name);
At client, use  window.top.Fusion.getWidgetById('Map').drawMap()  to
refresh the map.

Thks
Max !

----- Original Message ----
From: foolfish <[hidden email]>
To: [hidden email]
Sent: Tuesday, June 10, 2008 11:39:28 AM
Subject: Re: [mapguide-users] Running Search query from Task Pane in Fusion


1)install mapguide studio 2009, then you can create flexible weblayout. it's
for fusion.
note: you can't use base layer in map.

2)the map.open(map_name) might occrue error. the map_name is not the same as
traditional method(not use fusion),suppose the map name is asiamap , in
fusion it looks like asiamap_fusion4845627ed9705.

3)the parent.parent.mapFrame might occrue error. but you can use
parent.document.getElementById('Map').

4)parent.parent.mapFrame.Refresh() cann't be used, you can use
window.top.Fusion.getWidgetById('Map').drawMap()  to refresh map.

5)if you want to select feature,you should do:
at server, after selection.ToXml() ,you should add the follow line:
              selection.Save(resService, map_name);
at client, use  window.top.Fusion.getWidgetById('Map').drawMap()  to
refresh the map.


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



max_samart wrote:

>
> Hi All,
>           I am trying to migrate my application onto fusion(MGOS2.0.1)
> although  i managed to add maps and other basic functions ,overview map
> etc but i like to add my different customized search code into the fusion
> task pane which use to perform search and then return results in the same
> task pane and when i click on zoom icon, it use to select the feature and
> returns the info of the feature (Its working in the MGOS2.0.1 but i don't
> know how to get going into the Fusion-I tried adding the task in the task
> pane same as MapGuide Open Source and gave the path for the query file but
> it use to show file not found error).
> Thks
> Max !!
>
>
>
> _______________________________________________
> mapguide-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>

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

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


_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Running Search query from Task Pane in Fusion

xjimmyshcn
[the answer to your first question:]
in your pages of Task Panel,the following line can get the mapname you want:
 String mapName = Request.QueryString.Get("MAPNAME").Split(',')[0];
MAPNAME is a default URL parameters ,you can get it in the Task Pane pages
-----------------------------------------------------------------------------
[the answer to your second question:]
the following procedure can do a select at server:

     string map_name = Request.QueryString.Get("MAPNAME").Split(',')[0];
     String queryString = "ID='123'";  // filter condition
     String queryLayer =  "Line";       //Layer Name
     CreateSelectionXML_fusion(queryLayer, queryString, map_name);   //invoke CreateSelectionXML_fusion()
...
    public void CreateSelectionXML_fusion(String queryLayer, String queryString, String map_name)
    {
        MgResourceService resService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
        MgFeatureService featureService = (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);
        MgMap map = new MgMap();
        map.Open(resService, map_name);
        MgLayer layer = (MgLayer)map.GetLayers().GetItem(queryLayer);
        MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId());
        MgFeatureQueryOptions queryOption = new MgFeatureQueryOptions();
        queryOption.SetFilter(queryString);
        MgFeatureReader featureReader = featureService.SelectFeatures(resId, queryLayer, queryOption);
        MgSelection selection = new MgSelection(map);
        selection.AddFeatures(layer, featureReader, 0);
        OutputSelectionInHTML_fusion(selection, featureService, queryLayer);
        selectionXML = selection.ToXml();
        selection.Save(resService, map_name);  // this is the difference, must be saved.
        featureReader.Close();
    }


after finished runing the code above,when it return to client, the following code should be run:
<script type="text/javascript" > <b>parent.document.getElementById('Map').widget.aMaps[0].drawMap();</b> </script>
----------------------------------------------------------------------------

max_samart wrote
Hi,
                  Thanks for Lot of Details let me go through and try the steps to see how i can migarate the same application on Fusion+MapGuide.I have some more questions reagrding the same:
1. How to find the fusion name-like xyz_fusion4845627ed9705
2. Can you elaborate little bit more on the below-->
At server(? Path), after selection.ToXml() ,you should add the follow line:
selection.Save(resService, map_name);
At client, use  window.top.Fusion.getWidgetById('Map').drawMap()  to
refresh the map.

Thks
Max !


----- Original Message ----
From: foolfish <xjimmyshcn@sohu.com>
To: mapguide-users@lists.osgeo.org
Sent: Tuesday, June 10, 2008 11:39:28 AM
Subject: Re: [mapguide-users] Running Search query from Task Pane in Fusion


1)install mapguide studio 2009, then you can create flexible weblayout. it's
for fusion.
note: you can't use base layer in map.

2)the map.open(map_name) might occrue error. the map_name is not the same as
traditional method(not use fusion),suppose the map name is asiamap , in
fusion it looks like asiamap_fusion4845627ed9705.

3)the parent.parent.mapFrame might occrue error. but you can use
parent.document.getElementById('Map').

4)parent.parent.mapFrame.Refresh() cann't be used, you can use
window.top.Fusion.getWidgetById('Map').drawMap()  to refresh map.

5)if you want to select feature,you should do:
at server, after selection.ToXml() ,you should add the follow line:
              selection.Save(resService, map_name);
at client, use  window.top.Fusion.getWidgetById('Map').drawMap()  to
refresh the map.


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



max_samart wrote:
>
> Hi All,
>           I am trying to migrate my application onto fusion(MGOS2.0.1)
> although  i managed to add maps and other basic functions ,overview map
> etc but i like to add my different customized search code into the fusion
> task pane which use to perform search and then return results in the same
> task pane and when i click on zoom icon, it use to select the feature and
> returns the info of the feature (Its working in the MGOS2.0.1 but i don't
> know how to get going into the Fusion-I tried adding the task in the task
> pane same as MapGuide Open Source and gave the path for the query file but
> it use to show file not found error).
> Thks
> Max !!
>
>
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>

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

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



   
_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Running Search query from Task Pane in Fusion

lolob
Does anyone has a working query that works for fusion? I use example from 'querymain.php', but it didn't work at all under fusion.Can someone provide a sample that works for fusion.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Running Search query from Task Pane in Fusion

Shamrock Shooter
I have had similar problems with the search query throwing AJAX erros.

http://www.nabble.com/Fusion-Error-When-Selecting-From-Search-Results-td18161869.html
Reply | Threaded
Open this post in threaded view
|

Re: Running Search query from Task Pane in Fusion

lolob
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
Reply | Threaded
Open this post in threaded view
|

Re: Running Search query from Task Pane in Fusion

alba

hi lolob

Have you resolved your question?
I too have the same problem
Can You help me?
Thanks Alba