Rename {get|set}FeatureId to {get|set}Id

This commit is contained in:
Frederic Junod
2013-09-17 12:50:56 +02:00
parent c0486f6f65
commit 764aacb568
16 changed files with 27 additions and 27 deletions

View File

@@ -158,7 +158,7 @@ ol.expr.lib[ol.expr.functions.EXTENT] = function(minX, minY, maxX, maxY,
*/
ol.expr.lib[ol.expr.functions.FID] = function(var_args) {
var matches = false;
var id = this.getFeatureId();
var id = this.getId();
if (goog.isDef(id)) {
for (var i = 0, ii = arguments.length; i < ii; ++i) {
if (arguments[i] === id) {

View File

@@ -1,6 +1,6 @@
@exportSymbol ol.Feature
@exportProperty ol.Feature.prototype.getAttributes
@exportProperty ol.Feature.prototype.getFeatureId
@exportProperty ol.Feature.prototype.getId
@exportProperty ol.Feature.prototype.getGeometry
@exportProperty ol.Feature.prototype.set
@exportProperty ol.Feature.prototype.setGeometry

View File

@@ -74,7 +74,7 @@ ol.Feature.prototype.getAttributes = function() {
*
* @return {string|undefined} The feature's identifier.
*/
ol.Feature.prototype.getFeatureId = function() {
ol.Feature.prototype.getId = function() {
return this.featureId_;
};
@@ -118,7 +118,7 @@ ol.Feature.prototype.set = function(key, value) {
*
* @param {string|undefined} featureId The feature's identifier.
*/
ol.Feature.prototype.setFeatureId = function(featureId) {
ol.Feature.prototype.setId = function(featureId) {
this.featureId_ = featureId;
};

View File

@@ -144,7 +144,7 @@ ol.interaction.Select.prototype.select =
} else if (!(featureId in oldFeatureMap)) {
clone = new ol.Feature(feature.getAttributes());
clone.setGeometry(feature.getGeometry().clone());
clone.setFeatureId(feature.getFeatureId());
clone.setId(feature.getId());
clone.setSymbolizers(feature.getSymbolizers());
clone.renderIntent = ol.layer.VectorLayerRenderIntent.SELECTED;
featureMap[featureId] = clone;

View File

@@ -174,7 +174,7 @@ ol.parser.GeoJSON.prototype.parseFeature_ = function(json, opt_options) {
options = opt_options || {};
var feature = new ol.Feature(json.properties);
if (goog.isDef(json.id)) {
feature.setFeatureId(json.id);
feature.setId(json.id);
}
if (geomJson) {
var type = geomJson.type;

View File

@@ -128,7 +128,7 @@ ol.parser.KML = function(opt_options) {
}
var feature = new ol.Feature(container.properties);
if (!goog.isNull(id)) {
feature.setFeatureId(id);
feature.setId(id);
}
var geom = track.points[i];
if (geom) {
@@ -156,7 +156,7 @@ ol.parser.KML = function(opt_options) {
}
feature = new ol.Feature(container.properties);
if (!goog.isNull(id)) {
feature.setFeatureId(id);
feature.setId(id);
}
if (container.geometry) {
sharedVertices = undefined;
@@ -720,7 +720,7 @@ ol.parser.KML = function(opt_options) {
},
'_feature': function(feature) {
var node = this.createElementNS('Placemark');
var fid = feature.getFeatureId();
var fid = feature.getId();
if (goog.isDef(fid)) {
node.setAttribute('id', fid);
}

View File

@@ -320,7 +320,7 @@ ol.parser.ogc.GML = function(opt_options) {
var fid = node.getAttribute('fid') ||
this.getAttributeNS(node, this.defaultNamespaceURI, 'id');
if (!goog.isNull(fid)) {
feature.setFeatureId(fid);
feature.setId(fid);
}
obj.features.push(feature);
},
@@ -419,7 +419,7 @@ ol.parser.ogc.GML = function(opt_options) {
'_typeName': function(feature) {
var node = this.createElementNS('feature:' + this.featureType,
this.featureNS);
var fid = feature.getFeatureId();
var fid = feature.getId();
if (goog.isDef(fid)) {
this.setAttributeNS(node, this.defaultNamespaceURI, 'fid', fid);
}

View File

@@ -154,7 +154,7 @@ ol.parser.TopoJSON.prototype.readFeatureFromGeometry_ = function(object, arcs,
var feature = new ol.Feature();
feature.setGeometry(geometry);
if (goog.isDef(object.id)) {
feature.setFeatureId(String(object.id));
feature.setId(String(object.id));
}
return feature;
};