From 9cc7779858ee4492ac5ed14da1102ba44cf9dec4 Mon Sep 17 00:00:00 2001 From: Francisco Dans Date: Thu, 1 Oct 2015 18:42:55 +0200 Subject: [PATCH] one more test --- test/provider.tilejson.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/provider.tilejson.js b/test/provider.tilejson.js index 6c7f16b..e87d8e0 100644 --- a/test/provider.tilejson.js +++ b/test/provider.tilejson.js @@ -33,4 +33,25 @@ test("tile urls should be correctly formed for relative urls", function() { windshaft._ready = true; windshaft.getTileData({x: 0, y: 1, corrected: {x: 0, y: 1}}, 2, function() {}); equal(lastCall,"http://what.ev.er/./2/0/1.json.torque"); +}); + +test("tile urls should be correctly formed for absolute urls", function() { + torque.net.jsonp = function(url, callback) { + lastCall = url; + callback({ layergroupid: 'testlg', metadata: { torque: { 0: { data_steps:10 }} } }); + }; + torque.net.get = function(url, callback) { + lastCall = url; + var tilejson = '{"tiles": ["http://ca.ta.pam/{z}/{x}/{y}.json.torque"], "end": 903000, "column_type": "number", "start": 1000, "data_steps": 1, "resolution": 32}'; + callback({response: tilejson}); + }; + windshaft = new torque.providers.tileJSON({ + tileJSON: 'http://what.ev.er/tilejson.json', + cartocss: '#test{}', + resolution: 1, + steps: 10 + }); + windshaft._ready = true; + windshaft.getTileData({x: 0, y: 1, corrected: {x: 0, y: 1}}, 2, function() {}); + equal(lastCall,"http://ca.ta.pam/2/0/1.json.torque"); }); \ No newline at end of file