OpenLayers OpenLayers

Changeset 4090

Show
Ignore:
Timestamp:
08/28/07 19:58:15 (1 year ago)
Author:
crschmidt
Message:

check against the map instead, since Opera doesn't seem to have the same kind
of mouse positions.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/tests/Handler/test_Point.html

    r4063 r4090  
    5353        var handler = new OpenLayers.Handler.Point(control); 
    5454        var activated = handler.activate(); 
    55         var evt = {xy: new OpenLayers.Pixel(150, 75), which: 1}; 
     55        var px = new OpenLayers.Pixel(150, 75); 
     56        var evt = {xy: px, which: 1}; 
    5657        handler.mousedown(evt); 
    57         t.eq(handler.point.geometry.x, 0, "X is correct");  
    58         t.eq(handler.point.geometry.y, 0, "Y is correct");  
    59         t.ok(handler.point.geometry.getBounds().equals(new OpenLayers.Bounds(0,0,0,0)), "Correct bounds");  
     58        var lonlat = map.getLonLatFromPixel(px); 
     59        t.eq(handler.point.geometry.x, lonlat.lon, "X is correct");  
     60        t.eq(handler.point.geometry.y, lonlat.lat, "Y is correct");  
     61        t.ok(handler.point.geometry.getBounds().equals(new OpenLayers.Bounds(lonlat.lon,lonlat.lat,lonlat.lon,lonlat.lat)), "Correct bounds");  
    6062        var evt = {xy: new OpenLayers.Pixel(175, 100), which: 1}; 
    6163        handler.mousemove(evt);