{"action":"created","issue":{"url":"https://api.github.com/repos/Leaflet/Leaflet/issues/4195","repository_url":"https://api.github.com/repos/Leaflet/Leaflet","labels_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/4195/labels{/name}","comments_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/4195/comments","events_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/4195/events","html_url":"https://github.com/Leaflet/Leaflet/issues/4195","id":131441972,"number":4195,"title":"button switch between map / satellite layers","user":{"login":"ivanssa","id":3166174,"avatar_url":"https://avatars.githubusercontent.com/u/3166174?v=3","gravatar_id":"","url":"https://api.github.com/users/ivanssa","html_url":"https://github.com/ivanssa","followers_url":"https://api.github.com/users/ivanssa/followers","following_url":"https://api.github.com/users/ivanssa/following{/other_user}","gists_url":"https://api.github.com/users/ivanssa/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanssa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanssa/subscriptions","organizations_url":"https://api.github.com/users/ivanssa/orgs","repos_url":"https://api.github.com/users/ivanssa/repos","events_url":"https://api.github.com/users/ivanssa/events{/privacy}","received_events_url":"https://api.github.com/users/ivanssa/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-04T18:52:23Z","updated_at":"2016-02-12T00:41:50Z","closed_at":"2016-02-04T19:49:32Z","body":"Hello day I'm looking for a solution to create a button to switch between map / satellite layers, as in the example image below, someone could help in creating this switch style?\r\n\r\n![map_change](https://cloud.githubusercontent.com/assets/3166174/12825911/4e4b2aa0-cb57-11e5-972f-b60c06726694.jpg)\r\n"},"comment":{"url":"https://api.github.com/repos/Leaflet/Leaflet/issues/comments/183127860","html_url":"https://github.com/Leaflet/Leaflet/issues/4195#issuecomment-183127860","issue_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/4195","id":183127860,"user":{"login":"ivanssa","id":3166174,"avatar_url":"https://avatars.githubusercontent.com/u/3166174?v=3","gravatar_id":"","url":"https://api.github.com/users/ivanssa","html_url":"https://github.com/ivanssa","followers_url":"https://api.github.com/users/ivanssa/followers","following_url":"https://api.github.com/users/ivanssa/following{/other_user}","gists_url":"https://api.github.com/users/ivanssa/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanssa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanssa/subscriptions","organizations_url":"https://api.github.com/users/ivanssa/orgs","repos_url":"https://api.github.com/users/ivanssa/repos","events_url":"https://api.github.com/users/ivanssa/events{/privacy}","received_events_url":"https://api.github.com/users/ivanssa/received_events","type":"User","site_admin":false},"created_at":"2016-02-12T00:41:50Z","updated_at":"2016-02-12T00:41:50Z","body":"I could settle with the function found here https://github.com/angular-ui/ui-leaflet/issues/22 was all he needed to create my custom layer switch\r\n\r\n$ Scope.changeBaseLayer = function (key) {\r\n         leafletData.getMap (). Then (function (map) {\r\n             leafletData.getLayers (). Then (function (layers) {\r\n                 _.each (layers.baselayers, function (layer) {\r\n                     map.removeLayer (layer);\r\n                 });\r\n                 map.addLayer (layers.baselayers [key]);\r\n             });\r\n         });\r\n     };"}}