OpenLayers OpenLayers

Changeset 5369

Show
Ignore:
Timestamp:
12/10/07 18:01:24 (1 year ago)
Author:
crschmidt
Message:

Turn the pixels into geographic coordinates.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/examples/custom-control.html

    r5362 r5369  
    3434 
    3535                    notice: function (bounds) { 
    36                         alert(bounds); 
     36                        console.log(bounds); 
     37                        var ll = map.getLonLatFromPixel(new OpenLayers.Pixel(bounds.left, bounds.bottom));  
     38                        var ur = map.getLonLatFromPixel(new OpenLayers.Pixel(bounds.right, bounds.top));  
     39                        alert(ll.lon.toFixed(4) + ", " +  
     40                              ll.lat.toFixed(4) + ", " +  
     41                              ur.lon.toFixed(4) + ", " +  
     42                              ur.lat.toFixed(4)); 
    3743                    } 
    3844                });