<br><br>On Thursday, March 1, 2012, Scott Chapman wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The commented out code here works fine. It kicks off an XHR request<br>
to my server and fetches back points of interest and plots them.<br>
<br>
The uncommented versions here don't work. The XHR is never kicked off.<br>
<br>
I thought these would be equivalent. Can someone please tell me what<br>
I'm missing?<br>
<br>
<br>
//var vector_layer = new OpenLayers.Layer.Vector("Stores");<br>
var vector_layer = new OpenLayers.Layer.Vector("Stores", {<br>
strategies: [new OpenLayers.Strategy.Cluster()],</blockquote><div><br></div><div><br></div><div>The Cluster strategy won't fetch data for you. It is a data manipulation strategy, not a data fetching strategy. Add a Fixed strategy to the strategies array and it should work.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
protocol: new OpenLayers.Protocol.HTTP({<br>
url: "/kiosks_status_geoJSON/",<br>
headers: {'Accept':'application/json'},<br>
format: new OpenLayers.Format.GeoJSON()<br>
})<br>
});<br>
map.addLayer(vector_layer); // <-- This is here in both scenarios.<br>
<br>
//OpenLayers.Request.GET({<br>
//url: "/kiosks_status_geoJSON/",<br>
//headers: {'Accept':'application/json'},<br>
//success: function (req)<br>
//{<br>
//var g = new OpenLayers.Format.GeoJSON();<br>
//var feature_collection = g.read(req.responseText);<br>
//vector_layer.destroyFeatures();<br>
//vector_layer.addFeatures(feature_collection);<br>
//}<br>
//});<br>
<br>
Thanks!<br>
Scott<br>
_______________________________________________<br>
Users mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'Users@lists.osgeo.org')">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</blockquote><br><br>-- <br>Eric Lemoine<br><br>Camptocamp France SAS<br>Savoie Technolac, BP 352<br>73377 Le Bourget du Lac, Cedex<br><br>Tel : 00 33 4 79 44 44 96<br>Mail : <a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a><br>
<a href="http://www.camptocamp.com">http://www.camptocamp.com</a><br><br>