torque/test/provider.jsonarray.js

20 lines
492 B
JavaScript
Raw Permalink Normal View History

2014-12-09 22:46:03 +08:00
var torque = require('../lib/torque/core');
var jsonarray_fixture = require('./data/torque.array.json');
2013-07-24 18:20:53 +08:00
2014-12-09 22:46:03 +08:00
QUnit.module('provider.jsonarray');
2013-10-10 16:59:19 +08:00
2013-07-24 18:20:53 +08:00
test("processTile", function() {
var json = new torque.providers.JsonArray({
url: "http://test.com/{z}/{x}/{y}.json"
});
var tile = json.proccessTile(jsonarray_fixture.rows, {
x: 0,
y: 0,
z: 0
});
ok(tile);
equal(jsonarray_fixture.rows.length, tile.x.length);
equal(jsonarray_fixture.rows.length, tile.y.length);
});