[OpenLayers-Users] Proxy problem in GetFeatureInfo - nosolution??

sunny74 sb.ray at hotmail.com
Sun Mar 28 12:44:13 EDT 2010


Hi,

I am tryng to issue a command directly in IE for GFI like below:

http://localhost:9000/cgi-bin/mapserv.exe?map=../htdocs/shape/newwr1rec.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&STYLES=&EXCEPTIONS=application/vnd.ogc.se.xml&SRS=EPSG:4326&INFO_FORMAT=text/html&Width=600&height=600
&BBOX=70.4375 17.5375 76.0625
23.1625&X=420&Y=297&QUERY_LAYERS=STATE&FEATURE_COUNT=1

But it is giving dialog box to download mapserv.exe.

What Am I doing wrong?
Can someone provide me with the correct url.

My Mapfile is as given below:

# Map file created from QGIS project file D:/QGIS/newwr.qgs
# Edit this file to customize for your map interface
# (Created with PyQgis MapServer Export plugin)
MAP
  NAME newwr.map
  # Map image size
  SIZE 600 600
  UNITS dd
  EXTENT 67.440106 17.379867 78.390250 25.122977
  FONTSET "fonts.txt"
  PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
    ''
  END
  
  
  # Background color for the map canvas -- change as desired
  IMAGECOLOR 192 192 192
  IMAGEQUALITY 95
  IMAGETYPE gif
  OUTPUTFORMAT
    NAME GIF
    DRIVER 'GD/gif'
    MIMETYPE 'image/gif'
    #IMAGEMODE PC256
    EXTENSION 'gif'
  END
  
  # Legend
  LEGEND
      IMAGECOLOR 255 255 255
    STATUS ON
    KEYSIZE 18 12
    LABEL
      TYPE BITMAP
      SIZE MEDIUM
      COLOR 0 0 89
    END
  END
  
  # Web interface definition. Only the template parameter
  # is required to display a map. See MapServer documentation
  WEB
    # Set IMAGEPATH to the path where MapServer should
    # write its output.
    IMAGEPATH '/tmp/'

    # Set IMAGEURL to the url that points to IMAGEPATH
    # as defined in your web server configuration
    IMAGEURL '/tmp/'

    # WMS server settings
    METADATA
      'wms_title'           'newwr.map'
      'wms_feature_mime_type' 'text/plain'
      'wms_onlineresource' 
'http://localhost:9000/cgi-bin/mapserv?map=c:\ms4w\apache\htdocs\Shape\newwr1.map&'
      'wms_srs'             'EPSG:4326'
      'queryable'          'true'
      'wms_proxy_auth_type'    'ntlm'
      'wms_proxy_host'        'localhost'
      'wms_proxy_port'        '9000'
      'wms_proxy_type'        'http'
      'wms_proxy_username'    'subhro'
      'wms_proxy_password'    'subh26'
      'gml_include_items'    'all'
    
    END

    #Scale range at which web interface will operate
    # Template and header/footer settings
    HEADER   ../templates/Demo_header.html
    TEMPLATE ../templates/Demo_query_body.html
    FOOTER ../templates/Demo_footer.html
    
    # Only the template parameter is required to display a map. See
MapServer documentation
  END

  LAYER
    NAME 'STATE'
    TYPE POLYGON
    DATA 'C:\ms4w\Apache\htdocs\Shape\STATE.shp'
    
    METADATA
      'wms_title' 'STATE'
    END
    STATUS DEFAULT
    HEADER   ../templates/Demo_header.html
    TEMPLATE ../templates/Demo_query_body.html
    FOOTER ../templates/Demo_footer.html
    DUMP TRUE
    TRANSPARENCY 100
    PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
    ''
    END
    CLASS
       NAME 'STATE' 
       STYLE
         SYMBOL 0 
         SIZE 2 
         OUTLINECOLOR 0 0 0
         COLOR 255 255 127
       END
    END
  END

  
  LAYER
    
    NAME 'RailwayStations'
    TYPE POINT
    DATA 'C:\ms4w\Apache\htdocs\Shape\RailwayStations.shp'
    LABELITEM 'S_NAME'
    METADATA
      'wms_title' 'RailwayStations'
    END
    STATUS OFF
    HEADER   ../templates/Demo_header.html
    TEMPLATE ../templates/Demo_query_body.html
    FOOTER ../templates/Demo_footer.html
    DUMP TRUE
    TRANSPARENCY 100
    PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
    ''
    END
    CLASS
       NAME 'RailwayStations'
       STYLE
         SYMBOL 'CIRCLE' 
         SIZE 8 
         OUTLINECOLOR 0 0 0
         COLOR 255 0 0
       END
       LABEL 
                 COLOR 132 31 31 
                 SHADOWCOLOR 218 218 218 
                 SHADOWSIZE 2 2 
                 TYPE TRUETYPE 
                 FONT comic_sans-bold 
                 SIZE 6
                 ANTIALIAS TRUE 
                 POSITION AUTO
                 FORCE TRUE 
                 PARTIALS FALSE 
                MINDISTANCE 300 
                BUFFER 4 
            END # end of label 
    END
  END

  #Circle symbol
      SYMBOL
        NAME 'CIRCLE'
        TYPE ellipse
        FILLED true
        POINTS
          1 1
        END
      END 
END

And my JS function to call GetFeatureInfo is:

function init2() {
            //OpenLayers.ProxyHost =
"http://127.0.0.1:9000/cgi-bin/proxy.cgi?url=";
            
            map = new OpenLayers.Map('<%=map.ClientID%>');
            layer = new OpenLayers.Layer.WMS("OpenLayers WMS",
                "http://localhost:9000/cgi-bin/mapserv.exe?", { map:
'../htdocs/Shape/newwr1rec.map', layers: 'STATE', format: 'png' });
            layer1 = new OpenLayers.Layer.WMS("Rstations",
                "http://localhost:9000/cgi-bin/mapserv.exe?", { map:
'../htdocs/Shape/newwr1rec.map', transparent: true,layers:
'RailwayStations', format: 'png' });
            map.addLayers([layer,layer1]);

            //layer = new OpenLayers.Layer.WFS("OpenLayers WFS",
"http://127.0.0.1:9000/cgi-bin/mapserv.exe?map=d:/ms4w/apache/htdocs/Shape/newwr1.map",
{ typename: 'STATE', maxfeatures: 6 }, { featureClass:
OpenLayers.Feature.WFS });

            ///map.addLayer(layer);
            map.zoomToMaxExtent();

            map.setCenter(new OpenLayers.LonLat(73.25, 20.35), 6);
            map.addControl(new OpenLayers.Control.LayerSwitcher());
            map.events.register('click', map, function(e) {
                //alert('clicked');
                OpenLayers.Util.getElement('nodeList').innerHTML =
"Loading... please wait...";
                var url = layer.getFullRequestString({
                    REQUEST: "GetFeatureInfo",
                    EXCEPTIONS: "application/vnd.ogc.se_xml",
                    BBOX: map.getExtent().toBBOX(),
                    X: e.xy.x,
                    Y: e.xy.y,
                    INFO_FORMAT: 'text/plain',
                    QUERY_LAYERS: "RailwayStations",
                    LAYERS: "RailwayStations",
                    FEATURE_COUNT: 1,
                    WIDTH: map.size.w,
                    HEIGHT: map.size.h
                });
                //  var msg = document.getElementById('urlmsg');
                //  msg.value = url;
                alert(url, "getfeatureinfo",
"location=0,status=0,scrollbars=1,width=800,height=400");
                //window.open(url, '', this, setHTML, setHTML);
                OpenLayers.loadUrl(url, '', this, setHTML);
                OpenLayers.Event.stop(e);
            });



        }

I am at square 1 despite all the changes I have done in map file and code.
window.open is giving the same output as stated earlier and
OpenLayers.loadUrl(url, '', this, setHTML);
does not give any o/p.

Can someone help me get OpenLayers.loadUrl(url, '', this, setHTML);
working, any two formats.

I have been trying for 1 week now but without success.
PLs provide with a working solution.




-- 
View this message in context: http://n2.nabble.com/Proxy-problem-in-GetFeatureInfo-no-solution-tp4802810p4813726.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list