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:
@@ -16,7 +16,7 @@ OpenLayers.Handler.Point.prototype =
|
||||
OpenLayers.Class.inherit(OpenLayers.Handler, {
|
||||
|
||||
/**
|
||||
* @type OpenLayers.Geometry.Point
|
||||
* @type OpenLayers.Feature.Vector
|
||||
* @private
|
||||
*/
|
||||
point: null,
|
||||
@@ -87,10 +87,11 @@ OpenLayers.Handler.Point.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Add temporary geometries
|
||||
* Add temporary features
|
||||
*/
|
||||
createGeometry: function() {
|
||||
this.point = new OpenLayers.Geometry.Point();
|
||||
createFeature: function() {
|
||||
this.point = new OpenLayers.Feature.Vector(
|
||||
new OpenLayers.Geometry.Point());
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -112,7 +113,7 @@ OpenLayers.Handler.Point.prototype =
|
||||
/**
|
||||
* Destroy the temporary geometries
|
||||
*/
|
||||
destroyGeometry: function() {
|
||||
destroyFeature: function() {
|
||||
this.point.destroy();
|
||||
},
|
||||
|
||||
@@ -122,7 +123,7 @@ OpenLayers.Handler.Point.prototype =
|
||||
finalize: function() {
|
||||
this.layer.renderer.clear();
|
||||
this.callback("done", [this.geometryClone()]);
|
||||
this.destroyGeometry();
|
||||
this.destroyFeature();
|
||||
this.drawing = false;
|
||||
this.mouseDown = false;
|
||||
this.lastDown = null;
|
||||
@@ -135,7 +136,7 @@ OpenLayers.Handler.Point.prototype =
|
||||
cancel: function() {
|
||||
this.layer.renderer.clear();
|
||||
this.callback("cancel", [this.geometryClone()]);
|
||||
this.destroyGeometry();
|
||||
this.destroyFeature();
|
||||
this.drawing = false;
|
||||
this.mouseDown = false;
|
||||
this.lastDown = null;
|
||||
@@ -151,10 +152,10 @@ OpenLayers.Handler.Point.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Render geometries on the temporary layer.
|
||||
* Render features on the temporary layer.
|
||||
*/
|
||||
drawGeometry: function() {
|
||||
this.layer.renderer.drawGeometry(this.point, this.style);
|
||||
drawFeature: function() {
|
||||
this.layer.drawFeature(this.point, this.style);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -163,7 +164,7 @@ OpenLayers.Handler.Point.prototype =
|
||||
* @type OpenLayers.Geometry.Point
|
||||
*/
|
||||
geometryClone: function() {
|
||||
return this.point.clone();
|
||||
return this.point.geometry.clone();
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -183,14 +184,14 @@ OpenLayers.Handler.Point.prototype =
|
||||
return true;
|
||||
}
|
||||
if(this.lastDown == null) {
|
||||
this.createGeometry();
|
||||
this.createFeature();
|
||||
}
|
||||
this.lastDown = evt.xy;
|
||||
this.drawing = true;
|
||||
var lonlat = this.map.getLonLatFromPixel(evt.xy);
|
||||
this.point.x = lonlat.lon;
|
||||
this.point.y = lonlat.lat;
|
||||
this.drawGeometry();
|
||||
this.point.geometry.x = lonlat.lon;
|
||||
this.point.geometry.y = lonlat.lat;
|
||||
this.drawFeature();
|
||||
return false;
|
||||
},
|
||||
|
||||
@@ -204,9 +205,9 @@ OpenLayers.Handler.Point.prototype =
|
||||
mousemove: function (evt) {
|
||||
if(this.drawing) {
|
||||
var lonlat = this.map.getLonLatFromPixel(evt.xy);
|
||||
this.point.x = lonlat.lon;
|
||||
this.point.y = lonlat.lat;
|
||||
this.drawGeometry();
|
||||
this.point.geometry.x = lonlat.lon;
|
||||
this.point.geometry.y = lonlat.lat;
|
||||
this.drawFeature();
|
||||
}
|
||||
return true;
|
||||
},
|
||||
@@ -220,7 +221,7 @@ OpenLayers.Handler.Point.prototype =
|
||||
*/
|
||||
mouseup: function (evt) {
|
||||
if(this.drawing) {
|
||||
this.finalize(this.point);
|
||||
this.finalize();
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user