[GIS] OL3 bbox strategy on geoJSON vector layer

extentsgeojsonopenlayers

I try to improve my current OL-3 webmap to load less payload using the bbox strategy. So I altered my code similar to the bbox examples out there:

overlayGroup.getLayers().extend([
    new ol.layer.Vector({
    title: 'Nodes',
    source : new ol.source.Vector({
      format: new ol.format.GeoJSON(),
      loader: function(extent, resolution, projection) {
          alert("lol:"+extend);
        var url = '/api/nodes?bbox=' + extent.join(',');
        $.ajax({
          url: url,
          success: function(data) {
            source.addFeatures(source.readFeatures(data));
          }
        }); 
      },
      projection: 'EPSG:3857',
      strategy: ol.loadingstrategy.bbox()
      }),
    style: createNodeStyle(),
    }),
    new ol.layer.Vector({
    ....

Unfortunatly nothing get's displayed, but also no warnings appear. I'cant't debug as no breakpoint triggers and Firebug doesn't list any transfer 🙁
(If I remove the bbox specific stuff and witch back to a geoJSON source everything works fine)

Best Answer

I think you may have a problem with your strategy definition. Try dropping the '()' from 'strategy: ol.loadingstrategy.bbox()'