title: OpenLayers save a feature
body: <p>I'm creating a line which can be edited using this code: </p>
  
  <pre><code>    var line_points = Array();
      var lineLayer = new OpenLayers.Layer.Vector(label);
      this.map.addLayer(lineLayer);
      this.map.addControl(new OpenLayers.Control.DrawFeature(lineLayer, OpenLayers.Handler.Path));
  
      for ( x in points ) {
          var point = points[x].split(',');
          var lat = parseFloat( point[0] );
          var lon = parseFloat( point[1] );
          line_points[x] = new OpenLayers.Geometry.Point(this.Lon2Merc(lon), this.Lat2Merc(lat));
      }
  
      var line = new OpenLayers.Geometry.LineString(line_points);
      var lineFeature = new OpenLayers.Feature.Vector(line, null, style);
  
      lineLayer.addFeatures([lineFeature]);
  </code></pre>
  
  <p>I'm trying to pull the latitudes and longitudes out of this feature whenever a point is moved or created to update a HTML form which is then used to save that data. I've heard about the protocols and stuff, but don't think that's the right thing for me.</p>
  
  <p>Could someone point me in the right direction please?</p>
  
  <p>EDIT:
  I've tried getting the details from the HTML directly:</p>
  
  <pre><code>    var x = 0;
      var y = 0;
      $.each(document.getElementById("OpenLayers.Geometry.LineString_195").getAttribute("points").split(','), function(index, value) {
          if(index%2){
              y = value;
              console.log(MercatorToLatLon(x,y).Lat + "," + MercatorToLatLon(x,y).Lon);
          } else {
              x = value;
          }
          //console.log(value);
      });
  </code></pre>
  
  <p>but this doesn't seem to give any useful values, and in no particular order which I find strange.</p>