mercredi 28 janvier 2015

CartoDB Torque script causing JQuery UI conflict


I am using the torque library hosted here: http://ift.tt/1bVEEHv


I am using it in a viz.json-based visualization (so the torque layer is defined in the cartodb web console.) When I try to include a torque layer when I have imported JQuery, the visualization freezes with the following stacktrace: Uncaught TypeError: undefined is not a function cartodb.mod.torque.js:6 cdb.geo.ui.TimeSlider.cdb.geo.ui.InfoBox.extend.updateSlider cartodb.uncompressed.js:676 Backbone.Events.trigger cartodb.mod.torque.js:5 L.undefined.L.TorqueLayer.L.CanvasLayer.extend.setKey cartodb.mod.torque.js:5 (anonymous function) cartodb.mod.torque.js:3 r.time cartodb.mod.torque.js:3 r._tick


The torque visualization only if I remove my import of JQuery, which breaks other parts of the website, such as the tabs() function.


Below are the imports I am using, the first works for Torque but breaks tabs(), the second works for tabs() but breaks Torque.


For Torque: <script src="dist/torque.uncompressed.js"></script> <script src="http://ift.tt/1sC2WTz"></script> <script src="http://ift.tt/1GL1GFy"></script>


For no Torque: <script src="dist/torque.uncompressed.js"></script> <script src="http://ift.tt/1dLCJcb"></script> <script src="http://ift.tt/1sC2WTz"></script> <script src="http://ift.tt/1GL1GFy"></script>


The tabs error occurs at: $('#windowtabs').tabs(); Uncaught TypeError: undefined is not a function





Aucun commentaire:

Enregistrer un commentaire