Hi! I'm trying to make a openlayers app load a WFS layer from MapServer. This example looks very simple - http://openlayers.org/dev/examples/wfs-states.html
Anyway, my map is never showing. Here is the code:
var map;
function init(){
map = new OpenLayers.Map( 'map' );
var wfs = new OpenLayers.Layer.Vector("mundo", {
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
//OR ? url: "http://localhost/cgi-bin/mapserv?map=
// /home/daniel/comp/sig/mapserver/meumapa/8_wfs.map&", ??
url: "http://localhost/cgi-bin/mapserv",
featureType: "mundo",
featureNS: "http://localhost" //"http://www.openplans.org/topp"
})
});
map.addLayer(wfs);
// The following line gives this error:
// "Cannot call method 'getCenterLonLat' of null" :
map.zoomToMaxExtent();
}
And I found that openlayers is never making the request to mapserver,
which is on the same domain that the html page.
Also tried this, but it is the same:
//layer = new OpenLayers.Layer.WFS( "OpenLayers WMS",
"http://localhost/cgi-bin/mapserv?map=/home/daniel/comp/sig/mapserver/meumapa/8_wfs.map&mode=map&",
{layers: "mundo"});
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
