Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #95 from fredj/2708

getFeatureIdFromEvent return value. r=elemoine
  • Loading branch information...
commit 6725ee19402a11a5f8bf9c786b7f983a8bf79cd2 2 parents f79520c + 03b8406
Frédéric Junod fredj authored
2  lib/OpenLayers/Renderer.js
View
@@ -302,7 +302,7 @@ OpenLayers.Renderer = OpenLayers.Class({
* evt - {<OpenLayers.Event>}
*
* Returns:
- * {String} A feature id or null.
+ * {String} A feature id or undefined.
*/
getFeatureIdFromEvent: function(evt) {},
4 lib/OpenLayers/Renderer/Canvas.js
View
@@ -626,12 +626,12 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
* evt - {<OpenLayers.Event>}
*
* Returns:
- * {<OpenLayers.Feature.Vector} A feature or null. This method returns a
+ * {<OpenLayers.Feature.Vector} A feature or undefined. This method returns a
* feature instead of a feature id to avoid an unnecessary lookup on the
* layer.
*/
getFeatureIdFromEvent: function(evt) {
- var feature = null;
+ var feature;
if (this.hitDetection) {
// this dragging check should go in the feature handler
if (!this.map.dragging) {
6 lib/OpenLayers/Renderer/Elements.js
View
@@ -885,15 +885,13 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
* evt - {Object} An <OpenLayers.Event> object
*
* Returns:
- * {<OpenLayers.Geometry>} A geometry from an event that
- * happened on a layer.
+ * {String} A feature id or undefined.
*/
getFeatureIdFromEvent: function(evt) {
var target = evt.target;
var useElement = target && target.correspondingUseElement;
var node = useElement ? useElement : (target || evt.srcElement);
- var featureId = node._featureId;
- return featureId;
+ return node._featureId;
},
/**
7 lib/OpenLayers/Renderer/SVG.js
View
@@ -920,15 +920,14 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
* evt - {Object} An <OpenLayers.Event> object
*
* Returns:
- * {<OpenLayers.Geometry>} A geometry from an event that
- * happened on a layer.
+ * {String} A feature id or undefined.
*/
getFeatureIdFromEvent: function(evt) {
var featureId = OpenLayers.Renderer.Elements.prototype.getFeatureIdFromEvent.apply(this, arguments);
if(!featureId) {
var target = evt.target;
- featureId = target.parentNode && target != this.rendererRoot &&
- target.parentNode._featureId;
+ featureId = target.parentNode && target != this.rendererRoot ?
+ target.parentNode._featureId : undefined;
}
return featureId;
},
7 lib/OpenLayers/Renderer/SVG2.js
View
@@ -732,15 +732,14 @@ OpenLayers.Renderer.SVG2 = OpenLayers.Class(OpenLayers.Renderer.NG, {
* evt - {Object} An <OpenLayers.Event> object
*
* Returns:
- * {<OpenLayers.Geometry>} A geometry from an event that
- * happened on a layer.
+ * {String} A feature id or undefined.
*/
getFeatureIdFromEvent: function(evt) {
var featureId = OpenLayers.Renderer.Elements.prototype.getFeatureIdFromEvent.apply(this, arguments);
if(!featureId) {
var target = evt.target;
- featureId = target.parentNode && target != this.rendererRoot &&
- target.parentNode._featureId;
+ featureId = target.parentNode && target != this.rendererRoot ?
+ target.parentNode._featureId : undefined;
}
return featureId;
},
Please sign in to comment.
Something went wrong with that request. Please try again.