I'm working with geoserver and openlayers 3, i have a hosted layer in geoserver that i want display using ol3 as a wfs layer. it doesn't show any errors, but i dont get the map. it works with wms, but not wfs.
Please can anyone help me to fix that? This is my code :
var v=new ol.layer.Vector({ source: new ol.source.Vector({ format: new ol.format.WFS({ version: "1.1.0", url: "http://localhost:8080/geoserver/wfs", featurePrefix: "opengeo", //workspace featureType: "opengeo:region_geo", //layer name featureNS: "http://yourdomain/application/catalogLayer", geometryName: "geom", //feature name in database }) }) }); var map = new ol.Map({ **target: 'map-id', **layers: [ v ], view: new ol.View({ projection: 'EPSG:4326', center: [0, 0], zoom: 1 }) * *****}); I get this result :
أكثر...
Please can anyone help me to fix that? This is my code :
var v=new ol.layer.Vector({ source: new ol.source.Vector({ format: new ol.format.WFS({ version: "1.1.0", url: "http://localhost:8080/geoserver/wfs", featurePrefix: "opengeo", //workspace featureType: "opengeo:region_geo", //layer name featureNS: "http://yourdomain/application/catalogLayer", geometryName: "geom", //feature name in database }) }) }); var map = new ol.Map({ **target: 'map-id', **layers: [ v ], view: new ol.View({ projection: 'EPSG:4326', center: [0, 0], zoom: 1 }) * *****}); I get this result :
أكثر...