Hello, Thanks for your answer! I tried your example but it doesn't work with for example this site:
"http://gisopenbaar.overijssel.nl/data/B4/wfs?request=getcapabilities&typename=weidegebieden" get a error: CORS-header ‘Access-Control-Allow-Origin’ is not enabled........ I know that you can pass this through Yql. Because i use it for GetCapabilities to recieve the layers. Ad thats working fine. But i don't know how to use the recieved data to make the weidegebieden visible.:: var site = " http://gisopenbaar.overijssel.nl/data/B4/wfs?request=getcapabilities&typename=weidegebieden <https://geodata.nationaalgeoregister.nl/ahn2/wfs>"; // Take the provided url, and add it to a YQL query. Make sure you encode it! var yql1 = 'http://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent('select * from xml where url="' + site + '"') + '&format=xml&callback=?'; // Request that YSQL string, and run a callback function. $.getJSON(yql, cbFunc); function cbFunc(data) { // what to do with the data..... if (data.results[0]) { >>>>>>Use the data to make the wfs weidegebieden visible!!!!!!! But how???<<<<<< WfsOn(); <<<<<call the WFS like this or??????? } // ELSE Foutmelding else alert('error.'); } }; WFS call: var layerWFS = new ol.layer.Vector({ source: new ol.source.Vector({ loader: function(extent) {; $.ajax( document.getElementById("url").value, { data: { service: 'WFS', version: '1.1.0', request: 'getfeature', typename: document.getElementById("layer").value, srsname: 'EPSG:3857', bbox: extent.join(',') + ',EPSG:3857' }, }) .done(function(response) { layerWFS .getSource() .addFeatures(new ol.format.WFS() .readFeatures(response)); }); }, strategy: ol.loadingstrategy.bbox, }) }); function WfsOn(){ map.addLayer(layerWFS); } -- You received this message because you are subscribed to the Google Groups "OL3 Dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/ol3-dev. To view this discussion on the web visit https://groups.google.com/d/msgid/ol3-dev/693d0559-4e46-42f6-96c4-41096b3abd72%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
