The commented out code here works fine.  It kicks off an XHR request
to my server and fetches back points of interest and plots them.

The uncommented versions here don't work.  The XHR is never kicked off.

I thought these would be equivalent.  Can someone please tell me what
I'm missing?


       //var vector_layer = new OpenLayers.Layer.Vector("Stores");
       var vector_layer = new OpenLayers.Layer.Vector("Stores", {
         strategies: [new OpenLayers.Strategy.Cluster()],
           protocol: new OpenLayers.Protocol.HTTP({
                     url: "/kiosks_status_geoJSON/",
                 headers: {'Accept':'application/json'},
                  format: new OpenLayers.Format.GeoJSON()
           })
       });
       map.addLayer(vector_layer); // <-- This is here in both scenarios.

       //OpenLayers.Request.GET({
              //url: "/kiosks_status_geoJSON/",
              //headers: {'Accept':'application/json'},
              //success: function (req)
                       //{
                       //var g = new OpenLayers.Format.GeoJSON();
                       //var feature_collection = g.read(req.responseText);
                       //vector_layer.destroyFeatures();
                       //vector_layer.addFeatures(feature_collection);
                       //}
          //});

Thanks!
Scott
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to