[OpenLayers-Dev] Measure.js Hover / Partial Measure. New Event 'measurehover' and callback?

Andrew Hughes ahhughes at gmail.com
Tue Nov 16 04:44:51 EST 2010


Hi Guys,

This totally has me beaten :'( any help would be fantastic. I've tried to
hack the Hover handler and a few other ways but everything leads to a dead
end.

The Measure control has two events, EVENT_TYPES: ['measure',
'measurepartial'] . The measurepartial is triggered from a (single) click
(note sure how this actually works, something todo with handlers?). There is
also an 'measure' that is triggered from a double click (just as unsure).

How can I implement a 3rd event 'measurehover'? Basically I want to give
someone the ability to see "how far this click will measure, if you click
here".

This probably comes from the fact I don't understand (prototyping too well)
and this code in Measure.js...

    initialize: function(handler, options) {
        // concatenate events specific to measure with those from the base
        this.EVENT_TYPES =
            OpenLayers.Control.Measure.prototype.EVENT_TYPES.concat(
            OpenLayers.Control.prototype.EVENT_TYPES
        );
        OpenLayers.Control.prototype.initialize.apply(this, [options]);
        this.callbacks = OpenLayers.Util.extend(
            {done: this.measureComplete, point: this.measurePartial},
            this.callbacks
        );

        // let the handler options override, so old code that passes
'persist'
        // directly to the handler does not need an update
        this.handlerOptions = OpenLayers.Util.extend(
            {persist: this.persist}, this.handlerOptions
        );
        this.handler = new handler(this, this.callbacks,
this.handlerOptions);
    },

Thanks, it's really appreciated :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20101116/703727cd/attachment.html


More information about the Dev mailing list