send stat_tag in the url for windshaft

This commit is contained in:
javi 2014-10-02 09:07:49 +02:00
parent 4c985ca386
commit 8f101d78fc
3 changed files with 17 additions and 1 deletions

1
NEWS
View File

@ -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

View File

@ -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();
};

View File

@ -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',