check against the map instead, since Opera doesn't seem to have the same kind
of mouse positions. git-svn-id: http://svn.openlayers.org/trunk/openlayers@4090 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -52,11 +52,13 @@
|
|||||||
map.addControl(control);
|
map.addControl(control);
|
||||||
var handler = new OpenLayers.Handler.Point(control);
|
var handler = new OpenLayers.Handler.Point(control);
|
||||||
var activated = handler.activate();
|
var activated = handler.activate();
|
||||||
var evt = {xy: new OpenLayers.Pixel(150, 75), which: 1};
|
var px = new OpenLayers.Pixel(150, 75);
|
||||||
|
var evt = {xy: px, which: 1};
|
||||||
handler.mousedown(evt);
|
handler.mousedown(evt);
|
||||||
t.eq(handler.point.geometry.x, 0, "X is correct");
|
var lonlat = map.getLonLatFromPixel(px);
|
||||||
t.eq(handler.point.geometry.y, 0, "Y is correct");
|
t.eq(handler.point.geometry.x, lonlat.lon, "X is correct");
|
||||||
t.ok(handler.point.geometry.getBounds().equals(new OpenLayers.Bounds(0,0,0,0)), "Correct bounds");
|
t.eq(handler.point.geometry.y, lonlat.lat, "Y is correct");
|
||||||
|
t.ok(handler.point.geometry.getBounds().equals(new OpenLayers.Bounds(lonlat.lon,lonlat.lat,lonlat.lon,lonlat.lat)), "Correct bounds");
|
||||||
var evt = {xy: new OpenLayers.Pixel(175, 100), which: 1};
|
var evt = {xy: new OpenLayers.Pixel(175, 100), which: 1};
|
||||||
handler.mousemove(evt);
|
handler.mousemove(evt);
|
||||||
t.ok(!handler.point.geometry.getBounds().equals(new OpenLayers.Bounds(0,0,0,0)), "Bounds changed after moving mouse");
|
t.ok(!handler.point.geometry.getBounds().equals(new OpenLayers.Bounds(0,0,0,0)), "Bounds changed after moving mouse");
|
||||||
|
|||||||
Reference in New Issue
Block a user