0

I can't seem to get "date" columns to return for popups/infoWindows. I can retrieve other data types without an issue. I have the interactivity set correctly from what I can tell, but the featureClick callback only returns one column.

My code relies on v2 of the CartoDB API.

Here's my call to cartoDB.createLayer:

cartodb.createLayer( map, { type : "cartodb", options : layerData } )

where layerData is

interactivity: "name,admin_date,size"
query: "SELECT size, name, admin_date, the_geom_webmercator FROM book1"
table_name: "book1"
tile_style: "#book1{marker-width:5;marker-opacity: 0.9;marker-line-color: white;marker-fill:#e6e6e6;marker-line-width: 1;marker-line-opacity: 0.9;marker-placement: point;marker-type: ellipse;marker-allow-overlap: true;} #book1{[size>=0]{marker-fill:#b8cde9;}[size>=18229430]{marker-fill:#6693cc;}[size>=22061458]{marker-fill:#2f5f9d;}}"
user_name: "c2es"

The featureClick callback only return the first and last columns. Any ideas what's wrong?

1 Answer 1

2

This is due to a bug that doesn't allow to represent date columns in the interactions.

It is a bug already reported here: https://github.com/CartoDB/Windshaft/issues/103

As a workaround, you can cast the date column to text like this:

sql: "SELECT size, name, admin_date::text, the_geom_webmercator FROM book1"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.