0

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

http://myusername.cartodb.com/api/v1/map?stat_tag=API&lzma=3YCAiIBsXICAgICA...c3R1fHUC1tGnX6s9z1OH8TOP0X8G%2FnjsaKGG3A%3D%3D&callback=_cdbc_2758786579_1 

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) {
 console.log('Fine');
 })
 .error(function(e) {
 console.log(e);
 });
 }

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

asked Jul 17, 2015 at 12:12

1 Answer 1

0

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

answered Jul 17, 2015 at 18:54
1
  • tag your question as answered, please Commented Jul 20, 2015 at 7:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.