I am trying to build on the cartodb tutorial to develop a map of fibre networks in Africa. The example works fine when my SQL select is very simple i.e.
var layerSource = {
user_name: 'afterfibre',
type: 'cartodb',
sublayers: [{
sql: "SELECT * FROM af_fibrephase",
cartocss: $("#category").text()
}]
}
But when I attempt a more sophisticated query with a table join, such as below, the layer no longer renders.
var layerSource = {
user_name: 'afterfibre',
type: 'cartodb',
sublayers: [{
sql: "SELECT af_fibrephase.the_geom, af_fibrephase.live, af_organisation.name FROM af_fibrephase, af_organisation WHERE af_fibrephase.operator_id = af_organisation.organisation_id",
cartocss: $("#category").text()
}]
}
The SQL query tests ok via the API https://afterfibre.cartodb.com/api/v2/sql?q=SELECT%20af_fibrephase.the_geom,%20af_fibrephase.live,%20af_organisation.name%20FROM%20af_fibrephase,%20af_organisation%20WHERE%20af_fibrephase.operator_id%20=%20af_organisation.organisation_id
I sense I am doing something obvious wrong but can't work out what.