This commit is contained in:
javi 2014-12-19 09:33:31 +01:00
commit 2074a720a1
4 changed files with 34 additions and 4 deletions

5
NEWS
View File

@ -1,6 +1,9 @@
2.6.2
2.7.1
- Fix renderer not rendering marker-lines
2.7.0
- Adds option to not fetch map when instantiating a windshaft provider (#74)
2.6.1
- Fix marker fill opacity (#72)

View File

@ -33,8 +33,9 @@
var e = this.options.extra_params || (this.options.extra_params = {});
e.auth_token = this.options.auth_token;
}
this._fetchMap();
if (!this.options.no_fetch_map) {
this._fetchMap();
}
};
json.prototype = {

View File

@ -1,6 +1,6 @@
{
"name": "torque.js",
"version": "2.6.2",
"version": "2.7.1",
"description": "Torque javascript library",
"repository": {
"type": "git",

View File

@ -135,4 +135,30 @@ test("auth_token with several params as array param and present in url", functio
ok(lastCall.indexOf("auth_token[]=token2") !== -1);
});
[
{ shouldInvokeFetchMap: true, desc: 'undefined no_fetch_map option provided should invoke _fetchMap' },
{ no_fetch_map: false, shouldInvokeFetchMap: true, desc: 'no_fetch_map=false should invoke _fetchMap' },
{ no_fetch_map: true, shouldInvokeFetchMap: false, desc: 'no_fetch_map=true should NOT invoke _fetchMap' }
].forEach(function(fetchMapCase) {
test("no_fetch_map option: " + fetchMapCase.desc, function() {
var fetchMapFn = torque.providers.windshaft.prototype._fetchMap;
var _fetchMapInvoked = false;
torque.providers.windshaft.prototype._fetchMap = function() {
_fetchMapInvoked = true;
};
new torque.providers.windshaft({
table: 'test',
user: "rambo",
no_fetch_map: fetchMapCase.no_fetch_map
});
equal(_fetchMapInvoked, fetchMapCase.shouldInvokeFetchMap);
torque.providers.windshaft.prototype._fetchMap = fetchMapFn;
});
});