I have read and tested all the relative posts but I still don't have a solution for my problem.
I have a layer suscribers (points) stored in PostGIS database with srid=32232. I would like to display the layer in OpenLayers in geographic projection EPSG:4326. I can see the response with Firebug but get no display.
My code:
map file
MAP
IMAGETYPE PNG
EXTENT -180 -90 180 90
UNITS DD
SIZE 1500 650
IMAGECOLOR 255 255 255
FONTSET "fonts/fonts.list"
SYMBOLSET "symbols/symbols35.sym"
WEB
IMAGEPATH "tmp/tmp_img/"
IMAGEURL "**/guide/tmp/tmp_img/"
HEADER "query_header.html"
FOOTER "query_footer.html"
METADATA
"wfs_title" "WFS Guide" ## REQUIRED
"wfs_onlineresource" "http://*********/cgi-bin/mapserv.exe?" ## Recommended
"wfs_srs" "EPSG:4326" ## Recommended
"wfs_abstract" "This is the wfs service of guide" ## Recommended
"wfs_enable_request" "*" # necessary
END
END
PROJECTION
"init=epsg:4326"
END
LAYER # suscribers begin here
PROJECTION
"init=epsg:32232"
END
METADATA
"wfs_title" "suscribers" ##REQUIRED
"wfs_srs" "EPSG:4326" ## REQUIRED
"gml_include_items" "all" ## Optional (serves all attributes for layer)
"gml_featureid" "gid" ## REQUIRED
"wfs_enable_request" "*"
END
CONNECTIONTYPE postgis
NAME suscribers
CONNECTION "user=postgres dbname=postgis20 password=pass"
DATA "geom FROM public.suscribers USING UNIQUE gid USING SRID=32232"
STATUS ON
TYPE POINT
DUMP TRUE
END # suscribers ends here
END # end of map
openlayers
var map = new OpenLayers.Map('map',
{ controls: [],
allOverlays: false,
tileSize: new OpenLayers.Size(100, 100),
maxExtent: OpenLayers.Bounds.fromString("-180,-90,180,90"),
projection: new OpenLayers.Projection("EPSG:4326"),
displayProjection: new OpenLayers.Projection("EPSG:4326") //mouse position });
var basic = new OpenLayers.Layer.WMS("Basic",
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{ layers: 'basic' },
{ singleTile: true,
ratio: 1,
transitionEffect: 'resize',
opacity: 0.5
}
);
var wfsSuscribers = new OpenLayers.Layer.Vector("States",
{ protocol: new OpenLayers.Protocol.WFS(
{ url: "http://*********/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/routing/index.map&",
featureType: "suscribers",
featureNS: "http://****/routing"
}),
projection: new OpenLayers.Projection("EPSG:4326"),
strategies: [new OpenLayers.Strategy.BBOX()]
}
);
map.addLayers([basic, wfsSuscribers]); map.zoomToMaxExtent();
map.setCenter(new OpenLayers.LonLat(11.52, 3.83), 3);
response
<gml:boundedBy>
<gml:Box srsName="EPSG:4326">
<gml:coordinates>11.416136,3.714272 11.554812,3.969178</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<ms:suscribers fid="suscribers.2">
<gml:boundedBy>
<gml:Box srsName="EPSG:4326">
<gml:coordinates>11.521489,3.869029 11.521489,3.869029</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Point srsName="EPSG:4326">
<gml:coordinates>11.521489,3.869029</gml:coordinates>
</gml:Point>
</ms:msGeometry>
<ms:gid>2</ms:gid>
<ms:osm_id>331136682</ms:osm_id>
<ms:addr_house></ms:addr_house>
<ms:amenity></ms:amenity>
<ms:name>Yaoundé</ms:name>
<ms:barrier></ms:barrier>