CartoDB Torque script causing JQuery UI conflict

المشرف العام

Administrator
طاقم الإدارة
I am using the torque library hosted here: https://github.com/CartoDB/torque

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 works 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:

For no Torque:

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

You should be able to simulate this problem by trying to load the different sets of libraries as I posted -- on the one hand the torque visualization will freeze (if jquery is loaded), on the other hand, the torque visualization will work, but .tabs() will create an error.



أكثر...
 
أعلى