var vectorSourceJsonp = new ol.source.Vector({ format: new ol.format.GeoJSON(), loader: function(extent, resolution, projection) { var url = 'http://localhost:8082/geoserver/wfs?'+ 'service=WFS&request=GetFeature&'+ 'version=1.0.0&typeName=psatest3:OGRGeoJSON&'+ 'outputFormat=json&'+ 'format_options=callback:loadFeatures&' + 'srsname=EPSG:4326&'+ 'bbox=' + extent.join(','); $.ajax({ url: url, dataType: 'jsonp' }); }, strategy
l.loadingstrategy.bbox(), projection: 'EPSG:4326' }); var loadFeatures = function(response) { vectorSourceJsonp.addFeatures(vectorSourceJsonp.readFeatures(response)); }; var vectorLayerJsonp = new ol.layer.Vector({ source: vectorSourceJsonp, style: new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'green', width: 2 }) }) }); var mapJsonp = new ol.Map({ target: 'mapJsonp', renderer: 'canvas', layers: [ vectorLayerJsonp], view: new ol.View({ center: ol.proj.transform([-75.923853, 45.428736], 'EPSG:4326', 'EPSG:3857'), maxZoom: 19, zoom: 11 }) });I am not getting any output. Please advice on this where I have to modify the code.
أكثر...
أكثر...