Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new in Openlayers and web services in general, but until now I have managed to create a WMS (published by ArcGis to a server provided by uni) and connect it with Openlayers. Projection etc works properly but I don't know how to reach our WFS (e.g. GetFeatureInfo). I need it for applications like highlighing features from a search function, or mouse sensitive events. Any idea?

   function init() {

    var options = {
        projection: new OpenLayers.Projection("EPSG:3857"),
        units: "m",
        maxResolution: "auto",
        numZoomLevels: 22,
        maxExtent: new OpenLayers.Bounds(-3339584.723798, -30240971.958386,

                                          6679169.447596, 30240971.958386)

    map = new OpenLayers.Map('map', options);

    var wms = new OpenLayers.Layer.WMS(
            "WMS", "",
                  {layers: '1,2,3,4,5,6,7', version:'1.3.0', crs: 'EPSG:3857', transparent:true, isBaseLayer: true});

    var gsat = new OpenLayers.Layer.Google(
            "Google Satellite", {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}


    map.addControl(new OpenLayers.Control.LayerSwitcher());

    map.setCenter(new OpenLayers.LonLat(13.326169, 52.512134).transform(
        new OpenLayers.Projection("EPSG:4326"),
        map.getProjectionObject()), 16); 
share|improve this question
see this… – neogeomat Mar 29 '13 at 16:33
see this… – neogeomat Mar 29 '13 at 16:35
I have already checked this, but I just don't know what to put in url, FeatureType, FeatureNS fields. Sometimes there is a schema field as well... – Ellie Mar 29 '13 at 16:49
This question appears to be off-topic because it is too localised. – Devdatta Tengshe Oct 1 '13 at 5:46

In WMS request, if the layer is topp:tasmania_roads, then the FeatureType is tasmania_roads and FeatureNS is Namespace URI of topp. You can find the Namespace URI from workplace. For topp it is "". In My example below, the layer name in ris:trans_ln_8

var wfsroads = new OpenLayers.Layer.Vector("roadWFS", 
        {   strategies: [new OpenLayers.Strategy.BBOX()],
            //styleMap: new OpenLayers.StyleMap({   "default": new OpenLayers.Style(null, {rules: new OpenLayers.Rule()})}),
            protocol: new OpenLayers.Protocol.WFS({
                url:  host+port+"/geoserver/wfs",
                featureType: "trans_ln_8",
                featureNS: "http://geoserver/postgis",
                version: "1.1.0",
            displayInLayerSwitcher: false,
            visibility: false

This is the case in geoserver, if you are using ArcGIS server, you should probable look at OpenLayers.Layer.ArcGIS93Rest or OpenLayers.Layer.ArcIMS.

you can also look at OpenLayers.Protocol.WFS.fromWMSLayer, if you are successful in getting WMS layers.

share|improve this answer
Thank for your answer. Unfortunately, I couldn't make it work like this. Turns out that the solution is more comlpicated, using Esri JSON. However, neither this works until now in my case. – Ellie Apr 10 '13 at 13:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.