Failed to load resource: the server responded with a status of 400 (Bad Request)

587 views
Skip to first unread message

Andrew Molo

unread,
Jul 7, 2015, 1:27:51 PM7/7/15
to car...@googlegroups.com


Am new to cartodb and am  following this tutorial (http://docs.cartodb.com/tutorials/create_map_cartodbjs.html) on how to create a map.

When Implement the sql query, i get an error on the console saying "Failed to load resource: the server responded with a status of 400 (Bad Request)". I have included the screenshot of my browser displaying the error. 

 
 
 //sql
   
var subLayerOptions = {
      sql
: "SELECT * FROM my_cartodb_table_title WHERE city = 'CITY X' "
   
}


    cartodb
.createLayer(map, layerUrl/*, {no_cdn: true}*/)
   
.addTo(map)
   
.done( function(layer) {
      layer
.getSubLayer(0).set(subLayerOptions);
      data_layer
= layer.getSubLayer(0);
   
})
   
.error( function(err) {
      console
.log("some error occurred: " + err);
   
});


         
}


What could be the problem?
 
Thanks in advance,
Andrew





Nacho Sanchez

unread,
Jul 8, 2015, 1:58:08 AM7/8/15
to car...@googlegroups.com
Could you check layerUrl is right? If you take a look at your errors you'll see some "undefined" in the URLs where an identifier should be.

--

---
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/d/optout.



--
Juan Ignacio Sánchez Lara
CartoDB Team
Reply all
Reply to author
Forward
0 new messages