How have fusion developers integrated the file MapGuideViewerApi.js?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How have fusion developers integrated the file MapGuideViewerApi.js?

alba
How have fusion developers integrated the file MapGuideViewerApi.js to use AJAX Viewer  and Fusion ?

I use mapguide 2.0.2 and I would like to work with the file of C:\Programmi\MapGuideOpenSource2.0\WebServerExtensions\www\phpviewersample\query

I have now three problems:

1.
function SelectFeature(){

var resultSelect = document.getElementById("resultSelect");
            reqParams = "COMMAND=GETSELECTIONXML";
                        reqParams += "&SESSION=" + encodeURIComponent(session);
            reqParams += "&MAPNAME=" + encodeURIComponent(mapName);
                        reqParams += "&LAYERNAME=" + encodeURIComponent("Catastali");
                        reqParams += "&IDLIST=" + results[k].idList.toJSONString();
            if (msie)
                reqHandler = new ActiveXObject("Microsoft.XMLHTTP");
            else
                reqHandler = new XMLHttpRequest();

            reqHandler.open("POST", "querycontroller.php", false);
            reqHandler.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                        reqHandler.send(reqParams);
                        selectionXml = reqHandler.responseText;

            //parent.parent.mapFrame.SetSelectionXML(TrimString(selectionXml)); //mg 1.2
            sel=TrimString(selectionXml);

var map = GetParent().Fusion.getMapByName(mapName);
 map.setSelection(sel, true);//????????????? is not valid for multi selections! In this
}
case, how I can do?

2.
 I think that the file
C:\Programmi\MapGuideOpenSource2.0\WebServerExtensions\Help\viewerapi.html
is not update for mg 2.0.2, because the instruction 'setSelection'  does not
exist
where I can download a new viewer api?
I must resolve this function

  function submitRequest(pageUrl)
  {
          xmlSel = parent.parent.mapFrame.GetSelectionXML();
          if(xmlSel=='') alert("Selezionare Area Incendio");
          else{
          mapScale = parent.parent.mapFrame.GetScale();
          mapHeight = 600;
          mapWidth = 600;
          mapCenter = parent.parent.mapFrame.GetCenter();
          params = new Array("SESSION", parent.parent.mapFrame.GetSessionId(),
            "MAPNAME", parent.parent.mapFrame.GetMapName(),
            "SELECTION", xmlSel,
            "SCALE", mapScale,
            "HEIGHT", mapHeight,
            "WIDTH", mapWidth,
            "CENTERX", mapCenter.X,
            "CENTERY", mapCenter.Y
            );
          parent.parent.formFrame.Submit(pageUrl, params, "_blank");
          }// fine else
     }

3.
I would use in mapguide 2.0.2 the same templates of mg 2.0.1 es: aqua,
marron, ecc..
How can I do?

thanks Alba