[OpenLayers-Users] Some help with persistent layers and web server reponses.

Nathan Silver nsilver at imagesensingca.com
Wed Aug 11 11:42:01 EDT 2010


Hello all,

 

I've looked at  Peter Robbins' example of a persistent layer using GeoJSON
(http://maps.peterrobins.co.uk/files/ol6.html) which is well behaved. I've
been trying to duplicate the entire structure. I have my own IIS 7.5 running
on Windows 7 which in turn is connected to a SQL Server 2008 DB. Once I can
get OpenLayers to send the right query to IIS, I'll be away to the races.
Here's what's confounding me.

 

The working example issues a GET to retieve the GeoJSON data. The vector
layers is defined like this:

 

var vectorLayer = new OpenLayers.Layer.Vector("Line Vectors", {

styleMap: sm,

eventListeners: {

 "featuresadded": dataLoaded

 },

strategies: [

new OpenLayers.Strategy.Fixed(),

saveStrategy

],

protocol: new OpenLayers.Protocol.HTTP({

url: "/cgi-bin/fs/workspace/",

format: new OpenLayers.Format.GeoJSON({

ignoreExtraDims: true,

internalProjection: map.baseLayer.projection,

externalProjection: wgs84

})

})

});

 

 

My code only issues an OPTIONS request to the web server, something the
working example never does. If I step through the OpenLayers code with
Firebug, not only do I not see the OPTIONS request, I don't see anything
hitting the webserver at all. My vector layer is defined like this:

 

var vectors = new OpenLayers.Layer.Vector("Vector Layer", {

style: {

strokeColor: "blue",

                                strokeWidth: 3,

                                cursor: "pointer"

},

eventListeners: {

"featuresadded": dataLoaded

},

                strategies: [

                                new OpenLayers.Strategy.Fixed(), 

                                saveStrategy

],

                protocol: new OpenLayers.Protocol.HTTP({

                                url: "http://10.0.1.26/roads.aspx",

 

                                format: new OpenLayers.Format.GeoJSON({

                                                ignoreExtraDims: true,

                                                internalProjection:
map.baseLayer.projection,

                                                externalProjection: wgs84 

})

 })

});

 

 

If someone can help me understand why OpenLayers is requesting "OPTIONS"
from the server (which I can't even see from grepping  or stepping through
the code), and what I might need to go in order to get these two piece glued
together, I would really appreciate it.

 

Many thanks in advance,

Nathan Silver

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100811/312e2610/attachment.html


More information about the Users mailing list