#832 - changing the name of the second arg for the Feature.Vector constructor, mainly for documentation sake - note that this is not an api change - Feature.Vector inherits from Feature - Feature exposes a data property, Feature.Vector exposes an attributes property, both point to the same thing for Feature.Vector - this change does not alter that redundancy, only changes the argument names for the constructor - and adds tests - I'll leave the data/attributes property discussion for later

git-svn-id: http://svn.openlayers.org/trunk/openlayers@3717 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2007-07-12 16:36:36 +00:00
parent 6bd7edf628
commit 51b31bc0a0
2 changed files with 22 additions and 9 deletions

View File

@@ -66,17 +66,20 @@ OpenLayers.Feature.Vector.prototype =
* Parameters:
* geometry - {<OpenLayers.Geometry>} The geometry that this feature
* represents.
* data - {Object} An optional object that will be mapped to <attributes>.
* attributes - {Object} An optional object that will be mapped to the
* <attributes> property.
* style - {Object} An optional style object.
*/
initialize: function(geometry, data, style) {
OpenLayers.Feature.prototype.initialize.apply(this, [null, null, data]);
initialize: function(geometry, attributes, style) {
OpenLayers.Feature.prototype.initialize.apply(this,
[null, null, attributes]);
this.lonlat = null;
this.geometry = geometry;
this.state = null;
this.attributes = new Object();
if (data) {
this.attributes = OpenLayers.Util.extend(this.attributes, data);
if (attributes) {
this.attributes = OpenLayers.Util.extend(this.attributes,
attributes);
}
this.style = style ? style : null;
},