{"action":"created","issue":{"url":"https://api.github.com/repos/CartoDB/cartodb.js/issues/659","labels_url":"https://api.github.com/repos/CartoDB/cartodb.js/issues/659/labels{/name}","comments_url":"https://api.github.com/repos/CartoDB/cartodb.js/issues/659/comments","events_url":"https://api.github.com/repos/CartoDB/cartodb.js/issues/659/events","html_url":"https://github.com/CartoDB/cartodb.js/issues/659","id":103564584,"number":659,"title":" Can't hide a subLayer of a named map","user":{"login":"jsanz","id":188264,"avatar_url":"https://avatars.githubusercontent.com/u/188264?v=3","gravatar_id":"","url":"https://api.github.com/users/jsanz","html_url":"https://github.com/jsanz","followers_url":"https://api.github.com/users/jsanz/followers","following_url":"https://api.github.com/users/jsanz/following{/other_user}","gists_url":"https://api.github.com/users/jsanz/gists{/gist_id}","starred_url":"https://api.github.com/users/jsanz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsanz/subscriptions","organizations_url":"https://api.github.com/users/jsanz/orgs","repos_url":"https://api.github.com/users/jsanz/repos","events_url":"https://api.github.com/users/jsanz/events{/privacy}","received_events_url":"https://api.github.com/users/jsanz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CartoDB/cartodb.js/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/CartoDB/cartodb.js/labels/From%20Support","name":"From Support","color":"009800"}],"state":"open","locked":false,"assignee":{"login":"alonsogarciapablo","id":390398,"avatar_url":"https://avatars.githubusercontent.com/u/390398?v=3","gravatar_id":"","url":"https://api.github.com/users/alonsogarciapablo","html_url":"https://github.com/alonsogarciapablo","followers_url":"https://api.github.com/users/alonsogarciapablo/followers","following_url":"https://api.github.com/users/alonsogarciapablo/following{/other_user}","gists_url":"https://api.github.com/users/alonsogarciapablo/gists{/gist_id}","starred_url":"https://api.github.com/users/alonsogarciapablo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alonsogarciapablo/subscriptions","organizations_url":"https://api.github.com/users/alonsogarciapablo/orgs","repos_url":"https://api.github.com/users/alonsogarciapablo/repos","events_url":"https://api.github.com/users/alonsogarciapablo/events{/privacy}","received_events_url":"https://api.github.com/users/alonsogarciapablo/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-08-27T18:11:56Z","updated_at":"2015-11-02T19:00:38Z","closed_at":null,"body":"After loading a named map I can't hide any of the subLayers. Example code, more details below\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n    <title>Named Map with Interactivity | CartoDB.js</title>\r\n    <meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\" />\r\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"/>\r\n    <link rel=\"shortcut icon\" href=\"http://cartodb.com/assets/favicon.ico\" />\r\n    <style>\r\n        html, body, #map {\r\n            height: 100%;\r\n            padding: 0;\r\n            margin: 0;\r\n        }\r\n    </style>\r\n    <link rel=\"stylesheet\" href=\"http://libs.cartocdn.com/cartodb.js/v3/3.15/themes/css/cartodb.css\" />\r\n</head>\r\n<body>\r\n<div id=\"map\"></div>\r\n<script src=\"http://libs.cartocdn.com/cartodb.js/v3/3.15/cartodb.uncompressed.js\"></script>\r\n<script>\r\n    var myLayer,mySubLayer;\r\n    function main() {\r\n        var map = L.map('map', {\r\n          zoomControl: true,\r\n          center: [0,0],\r\n          zoom: 2\r\n        });\r\n\r\n        L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {\r\n          attribution: '&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors, &copy; <a href=\"http://cartodb.com/attributions\">CartoDB</a>'\r\n        }).addTo(map);\r\n        \r\n        var namedLayerSource = {\r\n            user_name: 'solutions',\r\n            type: 'namedmap',\r\n            auth_token: \"cartodb\",\r\n            named_map: {\r\n                name: \"named_map_test_2\"\r\n            }\r\n        };\r\n\r\n        // add cartodb layer with one sublayer\r\n        cartodb.createLayer(map, namedLayerSource,{https:true})\r\n          .addTo(map)\r\n          .done(function(layer) {\r\n              myLayer = layer;\r\n              mySubLayer = myLayer.getSubLayer(0);\r\n              mySubLayer.hide();\r\n          })\r\n          .error(function(err) {console.log(\"error: \" + err);});\r\n    }\r\n    window.onload = main;\r\n</script>\r\n</body>\r\n</html>\r\n``` \r\nWith the global `mySubLayer`, when I do a `.hide()` I can't see any call to the Maps API, after a `.show()` it calls it, also with a `hide()` but no changes occur on the map so not really sure if this is only a problem at the library or also at the API, or maybe elsewhere."},"comment":{"url":"https://api.github.com/repos/CartoDB/cartodb.js/issues/comments/153125129","html_url":"https://github.com/CartoDB/cartodb.js/issues/659#issuecomment-153125129","issue_url":"https://api.github.com/repos/CartoDB/cartodb.js/issues/659","id":153125129,"user":{"login":"ztephm","id":1779444,"avatar_url":"https://avatars.githubusercontent.com/u/1779444?v=3","gravatar_id":"","url":"https://api.github.com/users/ztephm","html_url":"https://github.com/ztephm","followers_url":"https://api.github.com/users/ztephm/followers","following_url":"https://api.github.com/users/ztephm/following{/other_user}","gists_url":"https://api.github.com/users/ztephm/gists{/gist_id}","starred_url":"https://api.github.com/users/ztephm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ztephm/subscriptions","organizations_url":"https://api.github.com/users/ztephm/orgs","repos_url":"https://api.github.com/users/ztephm/repos","events_url":"https://api.github.com/users/ztephm/events{/privacy}","received_events_url":"https://api.github.com/users/ztephm/received_events","type":"User","site_admin":false},"created_at":"2015-11-02T19:00:38Z","updated_at":"2015-11-02T19:00:38Z","body":"Hi, also happening for S/B 7170148"}}