Fix Strategy.BBOX test that failed due to mixed precision of coordinates.
This commit is contained in:
@@ -80,9 +80,26 @@
|
|||||||
strategy.update({force: true});
|
strategy.update({force: true});
|
||||||
var from = map.getProjectionObject();
|
var from = map.getProjectionObject();
|
||||||
var to = layer.projection;
|
var to = layer.projection;
|
||||||
t.eq(strategy.bounds.toString(), map.getExtent().transform(from, to).toString(), "[force update different proj] bounds transformed");
|
|
||||||
|
|
||||||
|
var strategyBounds = strategy.bounds,
|
||||||
|
mapExtent = map.getExtent().transform(from, to),
|
||||||
|
// we don't use bounds::toString because we might run into
|
||||||
|
// precision issues
|
||||||
|
precision = 7,
|
||||||
|
strategyBoundsGot = [
|
||||||
|
strategyBounds.left.toFixed( precision ),
|
||||||
|
strategyBounds.bottom.toFixed( precision ),
|
||||||
|
strategyBounds.right.toFixed( precision ),
|
||||||
|
strategyBounds.top.toFixed( precision )
|
||||||
|
].join(','),
|
||||||
|
mapExtentExpected = [
|
||||||
|
mapExtent.left.toFixed( precision ),
|
||||||
|
mapExtent.bottom.toFixed( precision ),
|
||||||
|
mapExtent.right.toFixed( precision ),
|
||||||
|
mapExtent.top.toFixed( precision )
|
||||||
|
].join(',');
|
||||||
|
t.eq(strategyBoundsGot, mapExtentExpected,
|
||||||
|
"[force update different proj] bounds transformed");
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_events(t) {
|
function test_events(t) {
|
||||||
|
|||||||
Reference in New Issue
Block a user