OpenLayers OpenLayers

Ticket #329 (closed feature: fixed)

Opened 2 years ago

Last modified 2 years ago

Incorporate OpenLayers.Control.LonLat as MousePosition

Reported by: crschmidt Assigned to: sderle
Priority: major Milestone: 2.2 Release
Component: Control Version:
Keywords: Cc:
State:

Description

Incorporate Jeff Dege's MousePosition control.

Attachments

mouseposition.patch (7.4 kB) - added by crschmidt on 10/06/06 13:52:02.

Change History

10/06/06 13:52:02 changed by crschmidt

  • attachment mouseposition.patch added.

10/06/06 14:19:22 changed by crschmidt

  • milestone set to 2.2 Release.

Moving to 2.2 release, if Jeff replies.

10/06/06 14:45:24 changed by crschmidt

Erik or Schuyler, can you look through this over for me?

10/06/06 15:11:29 changed by euzuro

Patch looks good and a very useful feature. Three comments:

1) why create 'element' ? OpenLayers.Control creates this.div, and doesn't seem to me like there is any reason to create another div (element) within that div. For simplicity, I think this should just use this.div

2)

 	93	        if (newHtml != this.element.innerHTML) 
 	94	            this.element.innerHTML = newHtml; 

according to CodingStandards this should be:

 	93	        if (newHtml != this.element.innerHTML) {
 	94	            this.element.innerHTML = newHtml; 
 	95	        }

3) Instead of calling

 	58	        this.map.events.register( 'mousemove', this, this.mousemove); 

from draw(), I think that line should be put in an overridden setMap() function -- although this works fine, a user *could* call draw on a control before (or without ever) adding it to the map... so we should wait until the map has actually been added for to attach this event.

4) Finally, I would suggest changing the function name mousemove to redraw

10/06/06 15:21:24 changed by crschmidt

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

1. We support using 'element' from the options hash, so we want to keep this.element around -- if we don't get passed one, just use this.div, rather than creating another one.

2. Done.

3. Yep, done.

4. I'm in favor.

With those four changes, I'm going to go ahead and commit r1665.