Skip to main content
2 of 2
added 299 characters in body
Jorge Sanz
  • 2.6k
  • 1
  • 16
  • 21

Two things here checking on your fiddle. First is you are putting the https:true option in the wrong place, you need to add it to the next parameter. In normal JS it would be like this:

      cartodb.createLayer(map, {
        user_name: 'user',
        filter: "mapnik",
        type: 'cartodb',
        sublayers: [{
          sql: layer_sql,
          cartocss: layer_cartocss,
          interactivity: 'cartodb_id, name, field1,field2'
        }]
      }, {
        https:true // here!
      })

The second error is that your tables are not public. You'll see a response of the Maps API like this on your console

Postgis Plugin: ERROR: permission denied for relation t7189c8441479760839c8fe7ebc3fbe5d_6d6d454828c05e8ceea03c99cc5f5...

In order to create layers with the Maps API on the fly your datasets need to have their privacy set to Public or Link, otherwise you need to use Named Maps and some kind of middleware to generate templates on the fly.

Jorge Sanz
  • 2.6k
  • 1
  • 16
  • 21