#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:
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user