OpenLayers OpenLayers

Ticket #1525 (closed feature: fixed)

Opened 7 months ago

Last modified 3 months ago

Small Bug in Click Event Example

Reported by: openlayers Assigned to:
Priority: trivial Milestone: 2.7 Release
Component: examples Version: 2.6
Keywords: Cc:
State: Complete

Description

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

(1) http://openlayers.org/dev/examples/click.html

my best regards,

Pedro Simonetti.

Attachments

ClickExampleMisplacedCommaFix.patch (0.8 kB) - added by openlayers on 04/22/08 22:23:42.

Change History

04/22/08 22:23:42 changed by openlayers

  • attachment ClickExampleMisplacedCommaFix.patch added.

04/22/08 22:27:00 changed by crschmidt

  • status changed from new to closed.
  • state set to Complete.
  • resolution set to fixed.

(In [6997]) Fix commas in Click example thanks to helpful patch from Pedro Simonetti. (Closes #1525)

09/05/08 01:35:40 changed by euzuro

  • component changed from general to examples.