diff --git a/NEWS b/NEWS index bbd8c9c..b12414f 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ - Add getActivePointsBBox method - Added renderer cache when the map is not animated - Added interaction method + - Added stat_tag in the map creation url for windshaft provider 2.4.01 - fixed rectangle anchor and size #42 diff --git a/lib/torque/provider.windshaft.js b/lib/torque/provider.windshaft.js index df0c69e..3a512f7 100644 --- a/lib/torque/provider.windshaft.js +++ b/lib/torque/provider.windshaft.js @@ -31,10 +31,13 @@ if (this.options.data_aggregation) { this.options.cumulative = this.options.data_aggregation === 'cumulative'; } + var e = this.options.extra_params || (this.options.extra_params = {}); if (this.options.auth_token) { - var e = this.options.extra_params || (this.options.extra_params = {}); e.auth_token = this.options.auth_token; } + if (this.options.stat_tag) { + e.stat_tag = this.options.stat_tag; + } this._fetchMap(); }; diff --git a/test/provider.windshaft.test.js b/test/provider.windshaft.test.js index e355aa8..4f40670 100644 --- a/test/provider.windshaft.test.js +++ b/test/provider.windshaft.test.js @@ -96,6 +96,18 @@ module('provider.windshaft', { ok(lastCall.indexOf("auth_token=test_auth_token") !== -1); }) + test("include stat_tag", function() { + windshaft_named = new torque.providers.windshaft({ + table: 'test', + user: "rambo", + stat_tag: 'test', + named_map: { + name: 'test_named' + } + }); + ok(lastCall.indexOf("stat_tag=test") !== -1); + }) + test("auth_token as array param", function() { windshaft_named = new torque.providers.windshaft({ table: 'test',