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 it in openlayers in geographic projection 4326. I can see the response with firebug but no display.
my code :
mapfile
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" "*" # necessaryENDENDPROJECTION "init=epsg:4326" ENDLAYER # 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 TRUEEND # suscribers ends hereEND # end of mapopenlayers
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); 11.416136,3.714272 11.554812,3.969178 11.521489,3.869029 11.521489,3.869029 11.521489,3.869029 2 331136682 Yaoundé Thank you.
أكثر...
I have a layer suscribers (points) stored in postgis database with srid=32232. I would like to display it in openlayers in geographic projection 4326. I can see the response with firebug but no display.
my code :
mapfile
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" "*" # necessaryENDENDPROJECTION "init=epsg:4326" ENDLAYER # 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 TRUEEND # suscribers ends hereEND # end of mapopenlayers
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); 11.416136,3.714272 11.554812,3.969178 11.521489,3.869029 11.521489,3.869029 11.521489,3.869029 2 331136682 Yaoundé Thank you.
أكثر...