[OpenLayers-Dev] Small Bug in Click Event Example

Pedro Simonetti Garcia pedrosimonetti at gmail.com
Tue Apr 22 23:31:22 EDT 2008


Hi Developers,

I found a little bug in the "Click Event Example" (1). There are two
commas (,)  misplaced at the end of some object declarations.
I guess someone forgot to remove those commas after some
refactoring in the code.

This is not a problem on good browsers, but unfurtunately, our best
friend ever IE simply returns an error on this case.

The 2 commas that should be removed are indicated in the following
code:

                initialize: function(options) {
                    this.handlerOptions = OpenLayers.Util.extend(
                        {}, this.defaultHandlerOptions
                    );
                    OpenLayers.Control.prototype.initialize.apply(
                        this, arguments
                    );
                    this.handler = new OpenLayers.Handler.Click(
                        this, {
                            'click': this.trigger, <==REMOVE-THIS
                        }, this.handlerOptions
                    );
                },

                trigger: function(e) {
                    var lonlat = map.getLonLatFromViewPortPx(e.xy);
                    alert("You clicked near " + lonlat.lat + " N, " +
                                              + lonlat.lon + " E");
                }, <==REMOVE-THIS


I've opened a new issue for this. The patch is in the tracker (2).

my best regards,

Pedro Simonetti.

(1) http://openlayers.org/dev/examples/click.html
(2) http://trac.openlayers.org/ticket/1525
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20080423/1fbd7fc0/attachment.html


More information about the Dev mailing list