English 中文(简体)
开放层
原标题:open layer GetFeatureInfo proxy setting

I have problems with this line, OpenLayers.ProxyHost = "proxy.cgi?url=";

在开放层法典中,除了上述字句外,还应做些什么?

My information I try to get feature information of WMS image using WMSGetFeatureInfo command.I am using openlayer 2.10 ,geoserver and apache-tomcat-6.0.35.I can run tomcat using localhost:8080 and geoserver using localhost:8080/geoserver.

我是开诚布公的,我经常看到关于开放式电车项目的问题,但是仍然无法回答。 你的任何答案对我来说是非常充分的吗?

Thanks for your valuable time.

最佳回答

这一联系可能有用:。 开放式轨道使用

Some of the tasks that OpenLayers performs (including WFS requests) require the use of a proxy script because of restrictions in JavaScript on the use of XMLHTTPRequest making requests to remote servers. Add that specific declaration before setting the map.

Start from here: http://openlayers.org/dev/examples/2

法典例:

    /*
     * 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 );
问题回答

暂无回答




相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...

热门标签