Compare commits

...

8 Commits

Author SHA1 Message Date
Francisco López
6a62d90a87 Fix node-qunit-phantomjs version 2017-02-16 17:54:53 +01:00
Francisco López
5761dc7bd6 Dist files 2017-02-16 17:47:34 +01:00
Francisco López
f0539404bf Fix underscore and carto versions 2017-02-16 17:47:10 +01:00
Francisco López
b2d4f55cec Use browserify var 2017-02-16 17:35:44 +01:00
Francisco López
755da6d19e Release 2.11.5 2017-02-16 17:32:15 +01:00
Francisco López
4e39245c10 Backport fix for #280: Remove width trick to use clear rect 2017-02-16 17:31:37 +01:00
Francisco López
a53de47f2d Make a local variable of ctx 2017-02-16 17:30:07 +01:00
Francisco López
b9442034ef Remove width trick to use clear rect, fix #280 2017-02-16 17:29:03 +01:00
8 changed files with 175 additions and 164 deletions

View File

@ -7,7 +7,7 @@ JS_CLIENT_FILES= lib/torque/*.js \
lib/torque/gmaps/*.js \ lib/torque/gmaps/*.js \
lib/torque/leaflet/leaflet_tileloader_mixin.js \ lib/torque/leaflet/leaflet_tileloader_mixin.js \
lib/torque/leaflet/canvas_layer.js \ lib/torque/leaflet/canvas_layer.js \
lib/torque/leaflet/torque.js lib/torque/leaflet/torque.js
all: dist/torque.js dist/torque.full.js add-header all: dist/torque.js dist/torque.full.js add-header
@ -35,7 +35,7 @@ add-header:
node lib/header.js node lib/header.js
prepare-test-suite: prepare-test-suite:
browserify test/suite.js > test/suite-bundle.js $(BROWSERIFY) test/suite.js > test/suite-bundle.js
test: prepare-test-suite test: prepare-test-suite
@echo "***tests***" @echo "***tests***"
@ -47,7 +47,7 @@ test-acceptance: clean-results
test-all: test test-acceptance test-all: test test-acceptance
clean: clean:
rm -rf dist rm -rf dist
.PHONY: clean dist_folder .PHONY: clean dist_folder

5
NEWS
View File

@ -1,5 +1,6 @@
2.11.5 2.11.5
- Backport fix for #280: Remove width trick to use clear rect.
2.11.4 2.11.4
- Static torque maps now draw correctly when unhiding them - Static torque maps now draw correctly when unhiding them
- Fixed animation always playing when rescaling - Fixed animation always playing when rescaling
@ -44,7 +45,7 @@
- Improved out of bounds correction function - Improved out of bounds correction function
- Fixed image-asset sizing - Fixed image-asset sizing
- Fixed items to load counter being sometimes negative - Fixed items to load counter being sometimes negative
2.8.0 2.8.0
- Supports use of external image markers via marker-file - Supports use of external image markers via marker-file
- Fixes Torque tiles not rendering outside normal lat/lng ranges. - Fixes Torque tiles not rendering outside normal lat/lng ranges.

10
dist/torque.full.js vendored

File diff suppressed because one or more lines are too long

View File

@ -4557,7 +4557,7 @@ var Filters = require('./torque_filters');
this.TILE_SIZE = 256; this.TILE_SIZE = 256;
this._style = null; this._style = null;
this._gradients = {}; this._gradients = {};
this._forcePoints = false; this._forcePoints = false;
} }
@ -4567,10 +4567,13 @@ var Filters = require('./torque_filters');
var canvas = this._canvas; var canvas = this._canvas;
var color = this._Map['-torque-clear-color'] var color = this._Map['-torque-clear-color']
// shortcut for the default value // shortcut for the default value
var ctx = this._ctx;
if (color === "rgba(255, 255, 255, 0)" || !color) { if (color === "rgba(255, 255, 255, 0)" || !color) {
this._canvas.width = this._canvas.width; ctx.save();
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.restore();
} else { } else {
var ctx = this._ctx;
ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.setTransform(1, 0, 0, 1, 0, 0);
var compop = this._Map['comp-op'] var compop = this._Map['comp-op']
ctx.globalCompositeOperation = compop2canvas(compop); ctx.globalCompositeOperation = compop2canvas(compop);
@ -4665,7 +4668,7 @@ var Filters = require('./torque_filters');
i.src = canvas.toDataURL(); i.src = canvas.toDataURL();
return i; return i;
} }
return canvas; return canvas;
}, },
@ -4693,7 +4696,7 @@ var Filters = require('./torque_filters');
} }
} }
} }
prof.end(true); prof.end(true);
return callback && callback(null); return callback && callback(null);
@ -4737,7 +4740,7 @@ var Filters = require('./torque_filters');
}, },
// //
// renders a tile in the canvas for key defined in // renders a tile in the canvas for key defined in
// the torque tile // the torque tile
// //
_renderTile: function(tile, key, frame_offset, sprites, shader, shaderVars) { _renderTile: function(tile, key, frame_offset, sprites, shader, shaderVars) {
@ -4774,7 +4777,7 @@ var Filters = require('./torque_filters');
} }
} }
} }
prof.end(true); prof.end(true);
}, },
@ -4925,7 +4928,7 @@ var Filters = require('./torque_filters');
} }
gradient = {}; gradient = {};
var colorize = this._style['image-filters'].args; var colorize = this._style['image-filters'].args;
var increment = 1/colorize.length; var increment = 1/colorize.length;
for (var i = 0; i < colorize.length; i++){ for (var i = 0; i < colorize.length; i++){
var key = increment * i + increment; var key = increment * i + increment;
@ -5672,31 +5675,6 @@ var objectKeys = Object.keys || function (obj) {
}; };
},{"util/":34}],30:[function(require,module,exports){ },{"util/":34}],30:[function(require,module,exports){
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
});
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
},{}],31:[function(require,module,exports){
(function (process){ (function (process){
// Copyright Joyent, Inc. and other Node contributors. // Copyright Joyent, Inc. and other Node contributors.
// //
@ -5924,7 +5902,7 @@ var substr = 'ab'.substr(-1) === 'b'
; ;
}).call(this,require('_process')) }).call(this,require('_process'))
},{"_process":32}],32:[function(require,module,exports){ },{"_process":31}],31:[function(require,module,exports){
// shim for using process in browser // shim for using process in browser
var process = module.exports = {}; var process = module.exports = {};
@ -6012,6 +5990,31 @@ process.chdir = function (dir) {
throw new Error('process.chdir is not supported'); throw new Error('process.chdir is not supported');
}; };
},{}],32:[function(require,module,exports){
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
});
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
},{}],33:[function(require,module,exports){ },{}],33:[function(require,module,exports){
module.exports = function isBuffer(arg) { module.exports = function isBuffer(arg) {
return arg && typeof arg === 'object' return arg && typeof arg === 'object'
@ -6609,7 +6612,7 @@ function hasOwnProperty(obj, prop) {
} }
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./support/isBuffer":33,"_process":32,"inherits":30}],35:[function(require,module,exports){ },{"./support/isBuffer":33,"_process":31,"inherits":32}],35:[function(require,module,exports){
(function (tree) { (function (tree) {
tree.functions = { tree.functions = {
@ -6942,7 +6945,7 @@ function stylize(str, style) {
} }
}).call(this,require('_process'),"/node_modules/carto/lib/carto") }).call(this,require('_process'),"/node_modules/carto/lib/carto")
},{"../../package.json":72,"./functions":35,"./parser":37,"./renderer":38,"./renderer_js":39,"./torque-reference":40,"./tree":41,"./tree/call":42,"./tree/color":43,"./tree/comment":44,"./tree/definition":45,"./tree/dimension":46,"./tree/element":47,"./tree/expression":48,"./tree/field":49,"./tree/filter":50,"./tree/filterset":51,"./tree/fontset":52,"./tree/frame_offset":53,"./tree/imagefilter":54,"./tree/invalid":55,"./tree/keyword":56,"./tree/layer":57,"./tree/literal":58,"./tree/operation":59,"./tree/quoted":60,"./tree/reference":61,"./tree/rule":62,"./tree/ruleset":63,"./tree/selector":64,"./tree/style":65,"./tree/url":66,"./tree/value":67,"./tree/variable":68,"./tree/zoom":69,"_process":32,"fs":28,"path":31,"util":34}],37:[function(require,module,exports){ },{"../../package.json":71,"./functions":35,"./parser":37,"./renderer":38,"./renderer_js":39,"./torque-reference":40,"./tree":41,"./tree/call":42,"./tree/color":43,"./tree/comment":44,"./tree/definition":45,"./tree/dimension":46,"./tree/element":47,"./tree/expression":48,"./tree/field":49,"./tree/filter":50,"./tree/filterset":51,"./tree/fontset":52,"./tree/frame_offset":53,"./tree/imagefilter":54,"./tree/invalid":55,"./tree/keyword":56,"./tree/layer":57,"./tree/literal":58,"./tree/operation":59,"./tree/quoted":60,"./tree/reference":61,"./tree/rule":62,"./tree/ruleset":63,"./tree/selector":64,"./tree/style":65,"./tree/url":66,"./tree/value":67,"./tree/variable":68,"./tree/zoom":69,"_process":31,"fs":28,"path":30,"util":34}],37:[function(require,module,exports){
(function (global){ (function (global){
var carto = exports, var carto = exports,
tree = require('./tree'), tree = require('./tree'),
@ -7727,7 +7730,7 @@ carto.Parser = function Parser(env) {
}; };
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./tree":41,"underscore":71}],38:[function(require,module,exports){ },{"./tree":41,"underscore":72}],38:[function(require,module,exports){
(function (global){ (function (global){
var _ = global._ || require('underscore'); var _ = global._ || require('underscore');
var carto = require('./index'); var carto = require('./index');
@ -8133,7 +8136,7 @@ module.exports.inheritDefinitions = inheritDefinitions;
module.exports.sortStyles = sortStyles; module.exports.sortStyles = sortStyles;
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./index":36,"underscore":71}],39:[function(require,module,exports){ },{"./index":36,"underscore":72}],39:[function(require,module,exports){
(function (global){ (function (global){
(function(carto) { (function(carto) {
var tree = require('./tree'); var tree = require('./tree');
@ -8425,7 +8428,7 @@ if(typeof(module) !== 'undefined') {
})(require('../carto')); })(require('../carto'));
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../carto":36,"./torque-reference":40,"./tree":41,"underscore":71}],40:[function(require,module,exports){ },{"../carto":36,"./torque-reference":40,"./tree":41,"underscore":72}],40:[function(require,module,exports){
var _mapnik_reference_latest = { var _mapnik_reference_latest = {
"version": "2.1.1", "version": "2.1.1",
"style": { "style": {
@ -10468,7 +10471,7 @@ tree.Call.prototype = {
})(require('../tree')); })(require('../tree'));
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../tree":41,"underscore":71}],43:[function(require,module,exports){ },{"../tree":41,"underscore":72}],43:[function(require,module,exports){
(function(tree) { (function(tree) {
// RGB Colors - #ff0014, #eee // RGB Colors - #ff0014, #eee
// can be initialized with a 3 or 6 char string or a 3 or 4 element // can be initialized with a 3 or 6 char string or a 3 or 4 element
@ -10845,7 +10848,7 @@ tree.Definition.prototype.toJS = function(env) {
})(require('../tree')); })(require('../tree'));
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../tree":41,"assert":29,"underscore":71}],46:[function(require,module,exports){ },{"../tree":41,"assert":29,"underscore":72}],46:[function(require,module,exports){
(function (global){ (function (global){
(function(tree) { (function(tree) {
var _ = global._ || require('underscore'); var _ = global._ || require('underscore');
@ -10948,7 +10951,7 @@ tree.Dimension.prototype = {
})(require('../tree')); })(require('../tree'));
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../tree":41,"underscore":71}],47:[function(require,module,exports){ },{"../tree":41,"underscore":72}],47:[function(require,module,exports){
(function(tree) { (function(tree) {
// An element is an id or class selector // An element is an id or class selector
@ -11368,7 +11371,7 @@ tree.Filterset.prototype.add = function(filter, env) {
}; };
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../tree":41,"underscore":71}],52:[function(require,module,exports){ },{"../tree":41,"underscore":72}],52:[function(require,module,exports){
(function(tree) { (function(tree) {
tree._getFontSet = function(env, fonts) { tree._getFontSet = function(env, fonts) {
@ -11912,7 +11915,7 @@ tree.Reference = ref;
})(require('../tree')); })(require('../tree'));
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../tree":41,"mapnik-reference":70,"underscore":71}],62:[function(require,module,exports){ },{"../tree":41,"mapnik-reference":70,"underscore":72}],62:[function(require,module,exports){
(function(tree) { (function(tree) {
// a rule is a single property and value combination, or variable // a rule is a single property and value combination, or variable
// name and value combination, like // name and value combination, like
@ -12314,7 +12317,7 @@ tree.StyleXML = function(name, attachment, definitions, env) {
})(require('../tree')); })(require('../tree'));
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../tree":41,"underscore":71}],66:[function(require,module,exports){ },{"../tree":41,"underscore":72}],66:[function(require,module,exports){
(function(tree) { (function(tree) {
tree.URL = function URL(val, paths) { tree.URL = function URL(val, paths) {
@ -12579,7 +12582,94 @@ refs.map(function(version) {
}); });
}).call(this,"/node_modules/carto/node_modules/mapnik-reference") }).call(this,"/node_modules/carto/node_modules/mapnik-reference")
},{"fs":28,"path":31}],71:[function(require,module,exports){ },{"fs":28,"path":30}],71:[function(require,module,exports){
module.exports={
"name": "carto",
"version": "0.15.1-cdb1",
"description": "CartoCSS Stylesheet Compiler",
"url": "https://github.com/cartodb/carto",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/cartodb/carto.git"
},
"author": {
"name": "CartoDB",
"url": "http://cartodb.com/"
},
"keywords": [
"maps",
"css",
"stylesheets"
],
"contributors": [
{
"name": "Tom MacWright",
"email": "macwright@gmail.com"
},
{
"name": "Konstantin Käfer"
},
{
"name": "Alexis Sellier",
"email": "self@cloudhead.net"
},
{
"name": "Raul Ochoa",
"email": "rochoa@cartodb.com"
},
{
"name": "Javi Santana",
"email": "jsantana@cartodb.com"
}
],
"licenses": [
{
"type": "Apache"
}
],
"bin": {
"carto": "./bin/carto"
},
"man": [
"./man/carto.1"
],
"main": "./lib/carto/index",
"engines": {
"node": ">=0.4.x"
},
"dependencies": {
"underscore": "~1.6.0",
"mapnik-reference": "~6.0.2",
"optimist": "~0.6.0"
},
"devDependencies": {
"mocha": "1.12.x",
"jshint": "0.2.x",
"sax": "0.1.x",
"istanbul": "~0.2.14",
"coveralls": "~2.10.1",
"browserify": "~7.0.0",
"uglify-js": "1.3.3"
},
"scripts": {
"pretest": "npm install",
"test": "mocha -R spec",
"coverage": "istanbul cover ./node_modules/.bin/_mocha && coveralls < ./coverage/lcov.info"
},
"gitHead": "8050ec843f1f32a6469e5d1cf49602773015d398",
"readme": "# CartoCSS\n\n[![Build Status](https://secure.travis-ci.org/mapbox/carto.png)](http://travis-ci.org/mapbox/carto)\n\nIs as stylesheet renderer for javascript, It's an evolution of the Mapnik renderer from Mapbox.\nPlease, see original [Mapbox repo](http://github.com/mapbox/carto) for more information and credits\n\n## Quick Start\n\n```javascript\n// shader is a CartoCSS object\n\nvar cartocss = [\n '#layer {',\n ' marker-width: [property]',\n ' marker-fill: red',\n '}'\n].join('')\nvar shader = new carto.RendererJS().render(cartocss);\nvar layers = shader.getLayers()\nfor (var i = 0; i < layers.length; ++i) {\n var layer = layers[i];\n console.log(\"layer name: \", layer.fullName())\n console.log(\"- frames: \", layer.frames())\n console.log(\"- attachment: \", layer.attachment())\n\n var layerShader = layer.getStyle({ property: 1 }, { zoom: 10 })\n console.log(layerShader['marker-width']) // 1\n console.log(layerShader['marker-fill']) // #FF0000\n}\n\n```\n\n# API\n\n## RendererJS\n\n### render(cartocss)\n\n## CartoCSS\n\ncompiled cartocss object\n\n### getLayers\n\nreturn the layers, an array of ``CartoCSS.Layer`` object\n\n### getDefault\n\nreturn the default layer (``CartoCSS.Layer``), usually the Map layer\n\n\n### findLayer(where)\n\nfind a layer using where object.\n\n```\nshader.findLayer({ name: 'test' })\n```\n\n## CartoCSS.Layer\n\n### getStyle(props, context)\n\nreturn the evaluated style:\n - props: object containing properties needed to render the style. If the cartocss style uses\n some variables they should be passed in this object\n - context: rendering context variables like ``zoom`` or animation ``frame``\n\n\n\n\n\n\n\n\n\n\n## Reference Documentation\n\n* [mapbox.com/carto](http://mapbox.com/carto/)\n\n\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/cartodb/carto/issues"
},
"homepage": "https://github.com/cartodb/carto#readme",
"_id": "carto@0.15.1-cdb1",
"_shasum": "9bd71a967caad86493561b8a335a38137aec3098",
"_from": "cartodb/carto#0.15.1-cdb1",
"_resolved": "git://github.com/cartodb/carto.git#8050ec843f1f32a6469e5d1cf49602773015d398"
}
},{}],72:[function(require,module,exports){
// Underscore.js 1.6.0 // Underscore.js 1.6.0
// http://underscorejs.org // http://underscorejs.org
// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
@ -13924,91 +14014,5 @@ refs.map(function(version) {
} }
}).call(this); }).call(this);
},{}],72:[function(require,module,exports){
module.exports={
"name": "carto",
"version": "0.15.1-cdb1",
"description": "CartoCSS Stylesheet Compiler",
"url": "https://github.com/cartodb/carto",
"repository": {
"type": "git",
"url": "http://github.com/cartodb/carto.git"
},
"author": {
"name": "CartoDB",
"url": "http://cartodb.com/"
},
"keywords": [
"maps",
"css",
"stylesheets"
],
"contributors": [
{
"name": "Tom MacWright",
"email": "macwright@gmail.com"
},
{
"name": "Konstantin Käfer"
},
{
"name": "Alexis Sellier",
"email": "self@cloudhead.net"
},
{
"name": "Raul Ochoa",
"email": "rochoa@cartodb.com"
},
{
"name": "Javi Santana",
"email": "jsantana@cartodb.com"
}
],
"licenses": [
{
"type": "Apache"
}
],
"bin": {
"carto": "./bin/carto"
},
"man": [
"./man/carto.1"
],
"main": "./lib/carto/index",
"engines": {
"node": ">=0.4.x"
},
"dependencies": {
"underscore": "~1.6.0",
"mapnik-reference": "~6.0.2",
"optimist": "~0.6.0"
},
"devDependencies": {
"mocha": "1.12.x",
"jshint": "0.2.x",
"sax": "0.1.x",
"istanbul": "~0.2.14",
"coveralls": "~2.10.1",
"browserify": "~7.0.0",
"uglify-js": "1.3.3"
},
"scripts": {
"pretest": "npm install",
"test": "mocha -R spec",
"coverage": "istanbul cover ./node_modules/.bin/_mocha && coveralls < ./coverage/lcov.info"
},
"readme": "# CartoCSS\n\n[![Build Status](https://secure.travis-ci.org/mapbox/carto.png)](http://travis-ci.org/mapbox/carto)\n\nIs as stylesheet renderer for javascript, It's an evolution of the Mapnik renderer from Mapbox.\nPlease, see original [Mapbox repo](http://github.com/mapbox/carto) for more information and credits\n\n## Quick Start\n\n```javascript\n// shader is a CartoCSS object\n\nvar cartocss = [\n '#layer {',\n ' marker-width: [property]',\n ' marker-fill: red',\n '}'\n].join('')\nvar shader = new carto.RendererJS().render(cartocss);\nvar layers = shader.getLayers()\nfor (var i = 0; i < layers.length; ++i) {\n var layer = layers[i];\n console.log(\"layer name: \", layer.fullName())\n console.log(\"- frames: \", layer.frames())\n console.log(\"- attachment: \", layer.attachment())\n\n var layerShader = layer.getStyle({ property: 1 }, { zoom: 10 })\n console.log(layerShader['marker-width']) // 1\n console.log(layerShader['marker-fill']) // #FF0000\n}\n\n```\n\n# API\n\n## RendererJS\n\n### render(cartocss)\n\n## CartoCSS\n\ncompiled cartocss object\n\n### getLayers\n\nreturn the layers, an array of ``CartoCSS.Layer`` object\n\n### getDefault\n\nreturn the default layer (``CartoCSS.Layer``), usually the Map layer\n\n\n### findLayer(where)\n\nfind a layer using where object.\n\n```\nshader.findLayer({ name: 'test' })\n```\n\n## CartoCSS.Layer\n\n### getStyle(props, context)\n\nreturn the evaluated style:\n - props: object containing properties needed to render the style. If the cartocss style uses\n some variables they should be passed in this object\n - context: rendering context variables like ``zoom`` or animation ``frame``\n\n\n\n\n\n\n\n\n\n\n## Reference Documentation\n\n* [mapbox.com/carto](http://mapbox.com/carto/)\n\n\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/cartodb/carto/issues"
},
"homepage": "https://github.com/cartodb/carto",
"_id": "carto@0.15.1-cdb1",
"_shasum": "62534c2975cbee073f10c6c14a0c7e889c9469e7",
"_resolved": "https://github.com/CartoDB/carto/archive/master.tar.gz",
"_from": "https://github.com/CartoDB/carto/archive/master.tar.gz"
}
},{}]},{},[10])(10) },{}]},{},[10])(10)
}); });

2
dist/torque.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/** /**
Torque 2.11.4 Torque 2.11.5
Temporal mapping for CartoDB Temporal mapping for CartoDB
https://github.com/cartodb/torque https://github.com/cartodb/torque
**/ **/
@ -4564,7 +4564,7 @@ var Filters = require('./torque_filters');
this.TILE_SIZE = 256; this.TILE_SIZE = 256;
this._style = null; this._style = null;
this._gradients = {}; this._gradients = {};
this._forcePoints = false; this._forcePoints = false;
} }
@ -4574,10 +4574,13 @@ var Filters = require('./torque_filters');
var canvas = this._canvas; var canvas = this._canvas;
var color = this._Map['-torque-clear-color'] var color = this._Map['-torque-clear-color']
// shortcut for the default value // shortcut for the default value
var ctx = this._ctx;
if (color === "rgba(255, 255, 255, 0)" || !color) { if (color === "rgba(255, 255, 255, 0)" || !color) {
this._canvas.width = this._canvas.width; ctx.save();
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.restore();
} else { } else {
var ctx = this._ctx;
ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.setTransform(1, 0, 0, 1, 0, 0);
var compop = this._Map['comp-op'] var compop = this._Map['comp-op']
ctx.globalCompositeOperation = compop2canvas(compop); ctx.globalCompositeOperation = compop2canvas(compop);
@ -4672,7 +4675,7 @@ var Filters = require('./torque_filters');
i.src = canvas.toDataURL(); i.src = canvas.toDataURL();
return i; return i;
} }
return canvas; return canvas;
}, },
@ -4700,7 +4703,7 @@ var Filters = require('./torque_filters');
} }
} }
} }
prof.end(true); prof.end(true);
return callback && callback(null); return callback && callback(null);
@ -4744,7 +4747,7 @@ var Filters = require('./torque_filters');
}, },
// //
// renders a tile in the canvas for key defined in // renders a tile in the canvas for key defined in
// the torque tile // the torque tile
// //
_renderTile: function(tile, key, frame_offset, sprites, shader, shaderVars) { _renderTile: function(tile, key, frame_offset, sprites, shader, shaderVars) {
@ -4781,7 +4784,7 @@ var Filters = require('./torque_filters');
} }
} }
} }
prof.end(true); prof.end(true);
}, },
@ -4932,7 +4935,7 @@ var Filters = require('./torque_filters');
} }
gradient = {}; gradient = {};
var colorize = this._style['image-filters'].args; var colorize = this._style['image-filters'].args;
var increment = 1/colorize.length; var increment = 1/colorize.length;
for (var i = 0; i < colorize.length; i++){ for (var i = 0; i < colorize.length; i++){
var key = increment * i + increment; var key = increment * i + increment;

View File

@ -57,7 +57,7 @@ var Filters = require('./torque_filters');
this.TILE_SIZE = 256; this.TILE_SIZE = 256;
this._style = null; this._style = null;
this._gradients = {}; this._gradients = {};
this._forcePoints = false; this._forcePoints = false;
} }
@ -67,10 +67,13 @@ var Filters = require('./torque_filters');
var canvas = this._canvas; var canvas = this._canvas;
var color = this._Map['-torque-clear-color'] var color = this._Map['-torque-clear-color']
// shortcut for the default value // shortcut for the default value
var ctx = this._ctx;
if (color === "rgba(255, 255, 255, 0)" || !color) { if (color === "rgba(255, 255, 255, 0)" || !color) {
this._canvas.width = this._canvas.width; ctx.save();
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.restore();
} else { } else {
var ctx = this._ctx;
ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.setTransform(1, 0, 0, 1, 0, 0);
var compop = this._Map['comp-op'] var compop = this._Map['comp-op']
ctx.globalCompositeOperation = compop2canvas(compop); ctx.globalCompositeOperation = compop2canvas(compop);
@ -165,7 +168,7 @@ var Filters = require('./torque_filters');
i.src = canvas.toDataURL(); i.src = canvas.toDataURL();
return i; return i;
} }
return canvas; return canvas;
}, },
@ -193,7 +196,7 @@ var Filters = require('./torque_filters');
} }
} }
} }
prof.end(true); prof.end(true);
return callback && callback(null); return callback && callback(null);
@ -237,7 +240,7 @@ var Filters = require('./torque_filters');
}, },
// //
// renders a tile in the canvas for key defined in // renders a tile in the canvas for key defined in
// the torque tile // the torque tile
// //
_renderTile: function(tile, key, frame_offset, sprites, shader, shaderVars) { _renderTile: function(tile, key, frame_offset, sprites, shader, shaderVars) {
@ -274,7 +277,7 @@ var Filters = require('./torque_filters');
} }
} }
} }
prof.end(true); prof.end(true);
}, },
@ -425,7 +428,7 @@ var Filters = require('./torque_filters');
} }
gradient = {}; gradient = {};
var colorize = this._style['image-filters'].args; var colorize = this._style['image-filters'].args;
var increment = 1/colorize.length; var increment = 1/colorize.length;
for (var i = 0; i < colorize.length; i++){ for (var i = 0; i < colorize.length; i++){
var key = increment * i + increment; var key = increment * i + increment;

View File

@ -1,6 +1,6 @@
{ {
"name": "torque.js", "name": "torque.js",
"version": "2.11.4", "version": "2.11.5",
"description": "Temporal mapping for CartoDB", "description": "Temporal mapping for CartoDB",
"repository": { "repository": {
"type": "git", "type": "git",
@ -26,20 +26,20 @@
} }
], ],
"dependencies": { "dependencies": {
"carto": "https://github.com/CartoDB/carto/archive/master.tar.gz" "carto": "CartoDB/carto#0.15.1-cdb1"
}, },
"devDependencies": { "devDependencies": {
"browserify": "^7.0.0", "browserify": "^7.0.0",
"canvas": "~1.2.1", "canvas": "~1.2.1",
"leaflet": "0.7.3", "leaflet": "0.7.3",
"mapnik": "https://github.com/CartoDB/node-mapnik/tarball/1.4.15-cdb1", "mapnik": "https://github.com/CartoDB/node-mapnik/tarball/1.4.15-cdb1",
"node-qunit-phantomjs": "^1.0.0", "node-qunit-phantomjs": "1.3.0",
"phantomjs-polyfill": "0.0.1", "phantomjs-polyfill": "0.0.1",
"qunit": "~0.7.5", "qunit": "~0.7.5",
"qunitjs": "1.x", "qunitjs": "1.x",
"request": "^2.53.0", "request": "^2.53.0",
"uglify-js": "1.3.3", "uglify-js": "1.3.3",
"underscore": "^1.6.0", "underscore": "~1.6.0",
"sinon": "^1.15.4" "sinon": "^1.15.4"
}, },
"scripts": { "scripts": {