I have successfully loaded the vector layer but the webpage only shows parts of it, some are not displayed. Any idea what might be the cause?

enter image description here

    var jsonSource_testLayer_1 = new ol.source.Vector({
    url: 'http://localhost:8080/geoserver/Testing1/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=Testing1%3AtestLayer&maxFeatures=50&outputFormat=application%2Fjson',
    format: new ol.format.GeoJSON(),

var lyr_testLayer_1 = new ol.layer.Vector({
    source: jsonSource_testLayer_1,

    style: style_testLayer_1,
    title: '<img src="styles/legend/testLayer_1.png" /> testLayer'


1 Answer 1


By default, GeoServer only delivers 10000 features on a WFS GetFeature request. You have configured it to deliver only 50. So you may want to change &maxfeatures=50 to something like &maxfeatures=20000. 20000 is a good setting because it is the maximum that OpenLayers can render smoothly on an average machine when zoomed out.

  • thank you so much. your reply solve my problem. Jul 29, 2019 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.