Changeset 5972
- Timestamp:
- 02/02/08 11:32:19 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/topp/nymap/lib/OpenLayers/Handler/Point.js
r5956 r5972 112 112 this.map.addLayer(this.layer); 113 113 } 114 115 this.createFeature(); 114 116 115 117 return true; … … 160 162 */ 161 163 finalize: function() { 164 this.cleanup("done"); 165 }, 166 167 /** 168 * APIMethod: cancel 169 * Finish the geometry and call the "cancel" callback. 170 */ 171 cancel: function() { 172 this.cleanup("cancel"); 173 }, 174 175 cleanup: function(callback) { 162 176 this.layer.eraseFeatures(this.point); 163 177 this.mouseDown = false; 164 178 this.lastDown = null; 165 179 this.lastUp = null; 166 this.callback("done", [this.geometryClone()]); 167 this.destroyFeature(); 168 }, 169 170 /** 171 * APIMethod: cancel 172 * Finish the geometry and call the "cancel" callback. 173 */ 174 cancel: function() { 175 this.layer.eraseFeatures(this.point); 176 this.mouseDown = false; 177 this.lastDown = null; 178 this.lastUp = null; 179 this.callback("cancel", [this.geometryClone()]); 180 this.callback(callback, [this.geometryClone()]); 180 181 this.destroyFeature(); 181 182 }, … … 258 259 */ 259 260 mousemove: function (evt) { 260 if (this.point == null) {261 this.createFeature();262 }263 264 261 var lonlat = this.map.getLonLatFromPixel(evt.xy); 265 262 this.point.geometry.x = lonlat.lon;
