Good afternoon,I'm trying to make a search engine in OpenLayers3 by Geoserver features and WFS.
To do this you should use a CQL filter? this is my connection code if geoserver mediantes OL3 would be so kind as to show me an example of CQL from Openlayers.
thank you very much
vectorWFS = new ol.source.Vector({ loader: function(extent,resolution,projection){ $.ajax('http://localhost:8080/geoserver/wfs',{ type: 'GET', data:{ service:'WFS', version:'1.1.0', request:'GetFeature', typename:'Botanico:Urbana', srsname:'EPSG:3857', outputFormat:'text/javascript' }, dataType:'jsonp', jsonpCallback:'callback:loadFeatures', jsonp:'format_options' }); } }); window.loadFeatures=function(response){ GeoJSON= new ol.format.GeoJSON(); vectorWFS.addFeatures(GeoJSON.readFeatures(response)); }; layerVector = new ol.layer.Vector({ source: vectorWFS, style: new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'rgba(0,0,255,1.0)', width: 2 }) }) });
أكثر...
To do this you should use a CQL filter? this is my connection code if geoserver mediantes OL3 would be so kind as to show me an example of CQL from Openlayers.
thank you very much
vectorWFS = new ol.source.Vector({ loader: function(extent,resolution,projection){ $.ajax('http://localhost:8080/geoserver/wfs',{ type: 'GET', data:{ service:'WFS', version:'1.1.0', request:'GetFeature', typename:'Botanico:Urbana', srsname:'EPSG:3857', outputFormat:'text/javascript' }, dataType:'jsonp', jsonpCallback:'callback:loadFeatures', jsonp:'format_options' }); } }); window.loadFeatures=function(response){ GeoJSON= new ol.format.GeoJSON(); vectorWFS.addFeatures(GeoJSON.readFeatures(response)); }; layerVector = new ol.layer.Vector({ source: vectorWFS, style: new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'rgba(0,0,255,1.0)', width: 2 }) }) });
أكثر...