Apache 打开图层GetFeatureInfo代理设置

Apache 打开图层GetFeatureInfo代理设置,apache,tomcat,proxy,openlayers,Apache,Tomcat,Proxy,Openlayers,我对这条线路有问题, OpenLayers.ProxyHost=proxy.cgi?url= 除了在开放层代码集中写在行上,还应该做什么 我的信息 我尝试使用WMSGetFeatureInfo命令获取WMS映像的功能信息。我使用openlayer 2.10、geoserver和apache-tomcat-6.0.35。我可以使用localhost:8080运行tomcat,使用localhost:8080/geoserver运行geoserver 我是OpenLayer的新手,我看到了有关Ope

我对这条线路有问题, OpenLayers.ProxyHost=proxy.cgi?url=

除了在开放层代码集中写在行上,还应该做什么

我的信息 我尝试使用WMSGetFeatureInfo命令获取WMS映像的功能信息。我使用openlayer 2.10、geoserver和apache-tomcat-6.0.35。我可以使用localhost:8080运行tomcat,使用localhost:8080/geoserver运行geoserver

我是OpenLayer的新手,我看到了有关OpenLayer项目的常见问题,但仍然无法找到答案。你的答案对我有很大帮助吗


感谢您的宝贵时间。

此链接可能很有用:

OpenLayers执行的某些任务(包括WFS请求)需要使用代理脚本,因为JavaScript中对使用XMLHTTPRequest向远程服务器发出请求的限制。 在设置映射之前添加该特定声明

从这里开始:

代码示例:

    /*
     * Fix for OpenLayers using 900913 for web mercator and AGS using 102113 (it must run before map init)
    OpenLayers.Layer.WMS.prototype.getFullRequestString = function(newParams,altUrl) {
        try {
            var projectionCode=typeof this.options.projection == 'undefined' ? this.map.getProjection() : this.options.projection;
        } catch(err){
            var projectionCode=this.map.getProjection();
        }
        this.params.SRS = projectionCode=="none" ? null : projectionCode;
        return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments);
    }

*/

    OpenLayers.ProxyHost = proxyPath;

    var options = {
        projection: mercator, //EPSG:3785/900913
        displayProjection: geographic, //EPSG:4326
        theme: null,
        maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),
        maxResolution: 156543.0339,
        units: 'm',
        controls: [],
        numZoomLevels: MAX_ZOOM_LEVEL,
        allOverlays: true
    };
    OpenLayers.Util.DEFAULT_PRECISION = 18;

    mp = new OpenLayers.Map('map', options);
    addMaps();
    addControls();
    mp.addLayers([googlePhysical, googleSatellite, googleStreets, googleHybrid]);
    //Enabling the preferred layers with a delay of 450 to be able to load the external backgrounds
    setTimeout(setInitialLayersDiv, 450);

    if (!mp.getCenter()) {
        if (document.getElementById('userMapExtent').value != '') {
            var sExtent = document.getElementById('userMapExtent').value.split(',');
            mp.zoomToExtent(new OpenLayers.Bounds(sExtent[0], sExtent[1], sExtent[2], sExtent[3]), true);
        } else {
            mp.zoomToExtent(europeGoogleExtent);
        }
    }
    J('#google_loading').hide('slow');

谢谢,这对我很有帮助