Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

At our scenario, there is a server which stores the feature info (coordinates, properties, etc) into a SQL database. Google Maps are used for a layer. The geoJSON data format are used for communication between our server and web mapping client. We want to create/use a WCF (Windows Communication Foundation) service as a communication protocol. Should I implement OpenLayers.Protocol.WFS as a WCF protocol because OpenLayers supports HTTP or WFS as protocol? Or which OpenLayers.Protocol (HTTP or WFS) should I prefer which design patterns provided at?

Thanks a lot for your helps and clarifications,

Yasemin

share|improve this question
add comment

1 Answer

Sorry, I never work with WCS, but I can clarify you a bit how to work with OL.

The OpenLayers.Protocol determines the way OL comunicates with the server, for example, using HTTP (OpenLayers.Protocol.HTTP) or using WFS (OpenLayers.Protocol.WFS).

The protocol class allows you to set a "format" property, which determines the way we can read/write from/to a specific data format, for example: OpenLayers.Format.KML, OpenLayers.Format.GeoJSON, etc.

You can create a OpenLayers.Protocol.HTTP instance by hand and set its format as OpenLayers.Format.GeoJSON.

At book OpenLayers Cookbook you have a recipe on "how to use protocols":

var geojsonReq = new OpenLayers.Protocol.HTTP({
    url: "URL_TO_YOUR_GeoJSON_FILE",
    format: new OpenLayers.Format.GeoJSON(),
    callback: addFeaturesFromResponse // Some function to manage features 
});
geojsonReq.read();

Cheers.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.