[OpenLayers-Dev] adding a 'begin' callback to the path handler...

John Cole john.cole at uai.com
Mon Dec 10 11:56:59 EST 2007


Ok, more handler work ☺

I’m looking to add a ‘begin’ callback to complement the ‘done’ callback for
the path handler.  Is the following the correct OpenLayer'ish way to do
this?

mousedown: function(evt) {
        // ignore double-clicks
        if (this.lastDown && this.lastDown.equals(evt.xy)) {
            return false;
        }
        if(this.lastDown == null) {
            this.createFeature();
	this.callback("begin", [this.geometryClone()]);	// <------ put call
back here.
        }
        this.mouseDown = true;
        this.lastDown = evt.xy;
        var lonlat = this.control.map.getLonLatFromPixel(evt.xy);
        this.point.geometry.x = lonlat.lon;
        this.point.geometry.y = lonlat.lat;
        if((this.lastUp == null) || !this.lastUp.equals(evt.xy)) {
            this.addPoint();
        }
        this.drawFeature();
        this.drawing = true;
        return false;
    }


Thanks,

John


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.17/1179 - Release Date: 12/9/2007
11:06 AM
 
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.



More information about the Dev mailing list