[OpenLayers-Users] Adding an attribute field to a vector layer

Arnd Wippermann arnd.wippermann at web.de
Wed Oct 15 13:44:52 EDT 2008


Hi Robert,
 
perhaps this is a way
 
register 'featureadded' for the vector layer
 
     *  - *featureadded* Triggered after a feature is added.  The event
     *      object passed to listeners will have a *feature* property with a
     *      reference to the added feature.

crop_layer.events.register('featureadded', crop_layer, regFeatureAdded);

function regFeatureAdded()
{
    this.attributes['name'] = 'name';
    this.attributes['description'] = 'description';
}
 
but I have it not tested.
 
Arnd Wippermann

  _____  

Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Robert Sanson
Gesendet: Mittwoch, 15. Oktober 2008 05:46
An: users at openlayers.org
Betreff: [OpenLayers-Users] Adding an attribute field to a vector layer


I am developing an application that allows a user to digitise crop areas.
The areas created will then be uploaded to a SQL-server database via a
geoJSON string sent to a ColdFusion service.
 
How can I specify one or more attribute fields?
 
I am using the following construct:
 
var crop_layer = new OpenLayers.Layer.Vector(); 
map.addLayer(crop_layer);
 
Many thanks,
 
Robert Sanson



------------------------------------------------------------------
The contents of this email are confidential to AsureQuality. If you have
received this communication in error please notify the sender immediately
and delete the message and any attachments. The opinions expressed in this
email are not necessarily those of AsureQuality. This message has been
scanned for known viruses before delivery. AsureQuality supports the
Unsolicited Electronic Messages Act 2007. If you do not wish to receive
similar communications in future, please notify the sender of this message.
------------------------------------------------------------------	



This message has been scanned for malware by SurfControl plc.
<http://www.surfcontrol.com/> www.surfcontrol.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20081015/3fd2a0a5/attachment.html


More information about the Users mailing list