I have a select query (really long) based on which I want to create a layer on google maps. I tried the same query in cartodbo map editor(online) it worked fine. But when I wrote a code to access the same data via javascript its failing with the error


here is my code

var mapOptions = {
            zoom: 8,
            center: new google.maps.LatLng(38.328732,-85.764771),
            mapTypeId: google.maps.MapTypeId.ROADMAP
          map = new google.maps.Map(document.getElementById('map'),  mapOptions);

            cartodb.createLayer(map, {
              user_name: 'myusername',
              type: 'cartodb',
              sublayers: [{
                sql: "SELECT * FROM cartodb1 where zcta5ce10 in (" + zipList + ")",
                cartocss: '#cartodb1 {polygon-fill: #FF6600;polygon-opacity: 0.7;line-color: #FFF;line-width: 0.5;line-opacity: 1;}'}]
            .addTo(map) // add the layer to our map which already contains 1 sublayer
            .done(function(layer) {
            .error(function(e) {


where zip list is quite huge so I posted it separately here http://textuploader.com/ase80


Ok found the solution! Was using older version of cartodb. As per @cge comments in Dynamic rendering on a layer with a long SQL query

  • tag your question as answered, please – Jorge Sanz Jul 20 '15 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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