Pullup r2999:3087 for RC2.

svn merge trunk/openlayers/@2999 trunk/openlayers/@HEAD branches/openlayers/2.4/



git-svn-id: http://svn.openlayers.org/branches/openlayers/2.4@3088 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-04-20 01:10:43 +00:00
parent b6fb16153c
commit b5103eb8ce
58 changed files with 1399 additions and 503 deletions
+17 -17
View File
@@ -21,9 +21,9 @@ OpenLayers.Handler.Feature.prototype =
layerIndex: null,
/**
* @type {OpenLayers.Geometry}
* @type {OpenLayers.Feature.Vector}
*/
geometry: null,
feature: null,
/**
* @constructor
@@ -33,7 +33,7 @@ OpenLayers.Handler.Feature.prototype =
* @param {Array} callbacks An object with a 'over' property whos value is
* a function to be called when the mouse is over
* a feature. The callback should expect to recieve
* a single argument, the geometry.
* a single argument, the feature.
* @param {Object} options
*/
initialize: function(control, layer, callbacks, options) {
@@ -75,7 +75,7 @@ OpenLayers.Handler.Feature.prototype =
/**
* Capture double-clicks. Let the event continue propagating if the
* double-click doesn't hit a geometry. Otherwise call the dblclick
* double-click doesn't hit a feature. Otherwise call the dblclick
* callback.
*
* @param {Event} evt
@@ -92,26 +92,26 @@ OpenLayers.Handler.Feature.prototype =
* @type {Boolean} A feature was selected
*/
select: function(type, evt) {
var geometry = this.layer.renderer.getGeometryFromEvent(evt);
if(geometry) {
var feature = this.layer.getFeatureFromEvent(evt);
if(feature) {
// three cases:
// over a new, out of the last and over a new, or still on the last
if(!this.geometry) {
// over a new geometry
this.callback('over', [geometry]);
} else if(this.geometry != geometry) {
if(!this.feature) {
// over a new feature
this.callback('over', [feature]);
} else if(this.feature != feature) {
// out of the last and over a new
this.callback('out', [this.geometry]);
this.callback('over', [geometry]);
this.callback('out', [this.feature]);
this.callback('over', [feature]);
}
this.geometry = geometry;
this.callback(type, [geometry]);
this.feature = feature;
this.callback(type, [feature]);
return true;
} else {
if(this.geometry) {
if(this.feature) {
// out of the last
this.callback('out', [this.geometry]);
this.geometry = null;
this.callback('out', [this.feature]);
this.feature = null;
}
return false;
}