Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i am new to GIS, openlayers, geoserver.... I managed to create simple vector layers using openlayers api. My question is how to save, for example vector layer, in order to use it later?

Thank you in advance.

This is the code:

var map;

    function init() {
       map = new OpenLayers.Map('map_element', {});

       // Setup our two layer objects
        var wms_layer_map = new OpenLayers.Layer.WMS(
        'Base layer',
        {layers: 'basic'},
        {isBaseLayer: true}

        var wms_layer_labels = new OpenLayers.Layer.WMS(
        'Location Labels',
        {layers: 'clabel,ctylabel,statelabel',
        transparent: true},
        {visibility: false,opacity: .5}

        var wms_state_lines = new OpenLayers.Layer.WMS(
        'State Line Layer',
        {layers: 'stateboundary',
        transparent: true},
        {displayInLayerSwitcher: false,
        minScale: 13841995.078125}

        var wms_water_depth = new OpenLayers.Layer.WMS(
        'Water Depth',
        {layers: 'depthcontour',
        transparent: true},

        var wms_roads = new OpenLayers.Layer.WMS(
        {layers: 'priroad,secroad,rail',
        transparent: true},

        var t2 = new OpenLayers.Layer.Vector(
            strategies: [new OpenLayers.Strategy.Fixed()]
            , projection: new OpenLayers.Projection("EPSG:2000")
            , protocol: new OpenLayers.Protocol.WFS({
                version: "1.1.0",
                url: "http://localhost:8080/geoserver/wfs",
                featurePrefix: "t2", //geoserver worspace name
                featureType: "t2", //geoserver Layer Name
                featureNS: "" // Edit Workspace Namespace URI
                //geometryName: "the_geom" // field in Feature Type details with type "Geometry"


        map.addControl(new OpenLayers.Control.LayerSwitcher({}));


All the layers are visible, execpt t2. Could you help me?

share|improve this question
What do you mean, when you say: 'save in order to use it later'? Can you clarify? – Devdatta Tengshe Apr 17 '13 at 16:29
I want to create vector layer with polygons and to save it. After that to use it when i will need it. Thank you – user17243 Apr 18 '13 at 12:36

Your Answer


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

Browse other questions tagged or ask your own question.