Why does this callback get ignored:
new OpenLayers.Layer.Vector("My layer",
{
projection : "EPSG:4326",
strategies : [ new OpenLayers.Strategy.Fixed(), refreshStrategy ],
protocol : new OpenLayers.Protocol.HTTP(
{
url : "myphpurl.php",
params : { rand : Math.random() * 1000 },
format : new OpenLayers.Format.GeoJSON(),
callback: function(){alert('test');}
}),
I'm trying to get access to how many features were returned…
Best Answer
Callback get ignored because it's possible is overridden by another callback function internally (e.g. OpenLayers.Strategy.BBOX.merge). Use events mechanism for get feature count:
According to documentation
callback
property ofOpenLayers.Protocol.HTTP
is not marked as APIProperty, so it is for internal use only.