cartodb.js release

198 views
Skip to first unread message

Javier Santana

unread,
Mar 1, 2013, 11:33:36 AM3/1/13
to car...@googlegroups.com
Hello,

We have just released a new version of cartodb.js with some fixes and improvements:

- added cartodb.nojquery.js to the cdn

No you could load http://libs.cartocdn.com/cartodb.js/v2/cartodb.nojquery.js file anduse your own jquery version located in other CDN, thanks to David Shorthouse for the advice.

- infowindow crops text when it is too large in infowindows headers
- infowindow converts links automatically
- fixed infowindow option in createVis #31
- fixed a problem with tiles cache when the data was update using SQL API
- added retina CartoDB logo
- some other minor fixes

It is deployed in our CDN so you don't have to do anything.

Thanks for your feedback

Enjoy your  weekend

Cheers

--
www.cartodb.com
Map, analyze and build applications with your data

Brian Flood

unread,
May 3, 2013, 1:46:32 PM5/3/13
to car...@googlegroups.com
how long before changes made via the SQL api show up in the tiles online? the api is returning new/upadated features but the tiles in the cartodb website are not updating

cheers
brian

Javier de la Torre

unread,
May 6, 2013, 4:19:29 AM5/6/13
to car...@googlegroups.com
Hi Brian,

This should not be the case. Can you tell us what is the SQL you are calling and the expected result? cartodb.js takes care of finding the latest version of the data and use that.

If you are getting something from the past there must be something not working properly or something we have missed.

The idea is that the changes are immediate. We change the URL on the CDN calls for the tiles, so caching at the browser or CDN level should not apply.

Best,


--
 
---
You received this message because you are subscribed to the Google Groups "cartodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cartodb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Brian Flood

unread,
May 6, 2013, 11:20:55 AM5/6/13
to car...@googlegroups.com
hi javier

ok, that's not what I'm seeing in the built-in CartoDB viewer (not a custom page using carto.js). these are simple CRUD operations (insert/update and delete) that seem to execute properly (the SQL api subsequently returns the correct results) but the map tiles are old. Even refreshing the page does not always fix the issue

I can send some test edits on a table if you need to view them on your end

cheers
brian 

Javier de la Torre

unread,
May 7, 2013, 4:41:23 AM5/7/13
to car...@googlegroups.com
Hi Brian,

There might be a slight delay on changing the data and getting refreshed tiles but I will get a video ASAP showing it.

Best,

Alejandro Martinez

unread,
May 7, 2013, 4:45:28 AM5/7/13
to car...@googlegroups.com
Hi Brian,

I'm going to try to find out what is happening, on the CartoDB UI the tiles shouldn't take time to refresh, could you give us some examples of what edits you're doing?

Thank you!
Alejandro

Brian Flood

unread,
May 7, 2013, 11:17:56 AM5/7/13
to car...@googlegroups.com
hello

the edits coming from the SQL API, so pretty standard Insert/Update/Delete SQL statements. They appears to work

ex:

HTTP/1.1 200 OK
Server: nginx
Date: Tue, 07 May 2013 15:11:47 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 39
Connection: keep-alive
X-Powered-By: Express
Content-Disposition: inline; filename=cartodb-query.json; modification-date="Tue, 07 May 2013 15:11:47 GMT";
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: X-Requested-With, X-Prototype-Version, X-CSRF-Token
Last-Modified: Tue, 07 May 2013 15:11:47 GMT
Cache-Control: no-cache,max-age=3600,must-revalidate,public
X-Varnish: 1204294749
Age: 0
Via: 1.1 varnish

{"time":0.007,"total_rows":1,"rows":[]}




the tiles in the viewer are often out of date, especially when several edits occur close together. When they do update, it's only for new zoom/extent areas (e.g. tiles for already viewed areas have the older data)

Javier de la Torre

unread,
May 7, 2013, 12:00:04 PM5/7/13
to car...@googlegroups.com
Can you try just changing the SQL API call from v2 to v1, just for test? Trying to replicate it here.

Brian Flood

unread,
May 7, 2013, 12:47:52 PM5/7/13
to car...@googlegroups.com
hi javier

changing to v1 does not seem to help any. can you replicate the issue?

brian

Javier de la Torre

unread,
May 7, 2013, 1:14:07 PM5/7/13
to car...@googlegroups.com
Ok, looking at this.

Thanks Brian.

Manuel Timita

unread,
Jul 2, 2013, 11:50:05 AM7/2/13
to car...@googlegroups.com
Hi all,

I just came across this thread by mistake. I have seen a similar behaviour as the one described by Brian.
Say, if the data attached to the features in the view is updated in the table via a POST query, then you zoom in or out, the tiles will be refreshed with the new data. However, whenever you get back to the zoom level at which you happened to update the data, the old tiles are still there, still with old interaction data. Clearing the cache does not help.

The same thing happens for as long as you access those tiles from the same IP, no matter the browser or if you clear the cache, and it stays like that for days. If one relies on the UI for visualisations, a simple workaround is just to change the name of the table after the update.

In JavaScript I got rid of this issue by 'busting' the layer query every time it is called:

var d = new Date(),
    t = d.getTime();

var buster = "'" + t + "' as buster";


cartodb.createLayer(map, "http://timita.cartodb.com/api/v1/viz/" + mytable + "/viz.json", {
            query: "SELECT *," + buster + " FROM {{table_name}}"
     })
     .on('done', function(layer) { //do whatever });


I hope it helps,
Manuel
Reply all
Reply to author
Forward
0 new messages