Good afternoon,I am trying to create a button openlayers search from 3 to wfs geoserver service. Or a file on Postgis GeoJSON or SHP.
My question is that in the new version 3.6.0 is not as accepted format: text / javascript and I always skip a mistake.
And make a CQL from OpenLayers to geoserver.I'm very lost in this situation.
Thank you very much for your time.
This is my code :
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 }) }) });
أكثر...
My question is that in the new version 3.6.0 is not as accepted format: text / javascript and I always skip a mistake.
And make a CQL from OpenLayers to geoserver.I'm very lost in this situation.
Thank you very much for your time.
This is my code :
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 }) }) });
أكثر...