diff --git a/lib/torque/renderer/cartocss_render.js b/lib/torque/renderer/cartocss_render.js index 2b2ed64..6e776a7 100644 --- a/lib/torque/renderer/cartocss_render.js +++ b/lib/torque/renderer/cartocss_render.js @@ -1,7 +1,3 @@ -(function(exports) { - - exports.torque = exports.torque || {}; - var TAU = Math.PI*2; // min value to render a line. // it does not make sense to render a line of a width is not even visible @@ -79,11 +75,8 @@ ctx.drawImage(img, 0, 0, w, h); } - exports.torque.cartocss = exports.torque.cartocss || {}; - exports.torque.cartocss = { +module.exports = { renderPoint: renderPoint, renderSprite: renderSprite, renderRectangle: renderRectangle - }; - -})(typeof exports === "undefined" ? this : exports); +}; diff --git a/lib/torque/renderer/index.js b/lib/torque/renderer/index.js new file mode 100644 index 0000000..9cde699 --- /dev/null +++ b/lib/torque/renderer/index.js @@ -0,0 +1,5 @@ +module.exports = { + cartocss: require('./cartocss_render'), + Point: require('./point'), + Rectangle: require('./rectangle') +}; \ No newline at end of file diff --git a/lib/torque/renderer/point.js b/lib/torque/renderer/point.js index 6b999ef..1c7f37f 100644 --- a/lib/torque/renderer/point.js +++ b/lib/torque/renderer/point.js @@ -1,6 +1,3 @@ -(function(exports) { - exports.torque = exports.torque || {}; - exports.torque.renderer = exports.torque.renderer || {}; var TAU = Math.PI * 2; var DEFAULT_CARTOCSS = [ @@ -237,6 +234,4 @@ // exports public api - exports.torque.renderer.Point = PointRenderer; - -})(typeof exports === "undefined" ? this : exports); +module.exports = PointRenderer; diff --git a/lib/torque/renderer/rectangle.js b/lib/torque/renderer/rectangle.js index 55febf3..cbb807b 100644 --- a/lib/torque/renderer/rectangle.js +++ b/lib/torque/renderer/rectangle.js @@ -1,6 +1,3 @@ -(function(exports) { - exports.torque = exports.torque || {}; - exports.torque.renderer = exports.torque.renderer || {}; var DEFAULT_CARTOCSS = [ '#layer {', @@ -158,6 +155,4 @@ // exports public api - exports.torque.renderer.Rectangle = RectanbleRenderer; - -})(typeof exports === "undefined" ? this : exports); +module.exports = RectanbleRenderer;