Resolved selection for MapGuide 2.0.2 and fusion 1.1.1

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

Resolved selection for MapGuide 2.0.2 and fusion 1.1.1

alba
hi all and thank very mach

- Install MapGuide 2.0.2
- rename fusion directory like fusion_old
- unzip fusion 1.1.1 in C:\Programmi\MapGuideOpenSource2.0\WebServerExtensions\www
- copy templates from fusion_old in fusion current
- copy config.json from fusion_old in fusion current
- apply http://trac.osgeo.org/fusion/ticket/213
- apply http://trac.osgeo.org/fusion/ticket/231
- apply http://trac.osgeo.org/mapguide/attachment/ticket/676/updated_openlayers_support.patch
- if you use mysql, in php.ini uncomment extension=php_mysql.dll


for selection

.....
var map = GetParent().Fusion.getMapByName(mapName);
var sel="";
var popup=0;

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);
            var selectionXml = reqHandler.responseText;
            sel=TrimString(selectionXml);
            map.setSelection(sel, true);
        }

function GetParent(){
    if(popup) {
        return opener;
    } else {
        return parent.parent;
    }
}

function submitRequest(pageUrl)
{
         var mapWidgetId = 'Map';
         var Fusion = window.top.Fusion;
         var mapWidget = Fusion.getWidgetById(mapWidgetId);
         var resultSelect = document.getElementById("resultSelect");
         var k=resultSelect.value;
         feature = results[k];
         //alert(results[k].displayValue);
         //alert(feature.idList.toJSONString());
         //alert(feature.centerX);
         //alert(feature.centerY);
         var valoreSelect=results[k].displayValue;

        mapScale = mapWidget.getScale();
        var size = mapWidget.getSize();  
        mapHeight = size.h;
        mapWidth = size.w;
        sessione=mapWidget.getSessionID();
        mappa=mapWidget.getMapName();

         // zoom first object selectioned in resultSelect
        var extent=mapWidget.getExtentFromPoint(feature.centerX,feature.centerY,mapScale);
        mapWidget.setExtents(extent);

        var params = [];
        params.push('SESSION='+sessione);
        params.push('MAPNAME='+mappa);
        params.push('SCALE='+mapScale);
        params.push('HEIGHT='+mapHeight);
        params.push('WIDTH='+mapWidth);
        params.push('CENTERX='+feature.centerX);
        params.push('CENTERY='+feature.centerY);
        params.push('SELEZIONE='+valoreSelect);// selection object in resultSelect
        params.push('SELECTION='+sel);// var global set in SelectFeature()
                                   
        params = params.concat(this.additionalParameters);

        if (pageUrl.indexOf('?') < 0) {
            pageUrl += '?';
           } else if (pageUrl.slice(-1) != '&') {
                  pageUrl += '&';
                 }
                pageUrl += params.join('&');
                window.open(pageUrl, "", "toolbar=no,status=no,width=500,height=500,resizable,scrollbars=yes");
  }

thank very mach for users of Forum

I must resolve the problem of multiple selection
Can anybody help me?

bye bye
Alba