{"action":"closed","issue":{"url":"https://api.github.com/repos/fabianbormann/osm-map/issues/4","repository_url":"https://api.github.com/repos/fabianbormann/osm-map","labels_url":"https://api.github.com/repos/fabianbormann/osm-map/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/fabianbormann/osm-map/issues/4/comments","events_url":"https://api.github.com/repos/fabianbormann/osm-map/issues/4/events","html_url":"https://github.com/fabianbormann/osm-map/issues/4","id":147903081,"number":4,"title":"layers \"readOnly: true\"","user":{"login":"luviiit","id":7158765,"avatar_url":"https://avatars.githubusercontent.com/u/7158765?v=3","gravatar_id":"","url":"https://api.github.com/users/luviiit","html_url":"https://github.com/luviiit","followers_url":"https://api.github.com/users/luviiit/followers","following_url":"https://api.github.com/users/luviiit/following{/other_user}","gists_url":"https://api.github.com/users/luviiit/gists{/gist_id}","starred_url":"https://api.github.com/users/luviiit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luviiit/subscriptions","organizations_url":"https://api.github.com/users/luviiit/orgs","repos_url":"https://api.github.com/users/luviiit/repos","events_url":"https://api.github.com/users/luviiit/events{/privacy}","received_events_url":"https://api.github.com/users/luviiit/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fabianbormann/osm-map/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-12T23:31:35Z","updated_at":"2016-04-14T08:57:34Z","closed_at":"2016-04-14T08:57:34Z","body":"Hey, in https://github.com/fabianbormann/osm-map/blob/master/osm-map.html#L85 the value of `layers` property is set to read only. This disables resetting `this.layers` to `[]` in https://github.com/fabianbormann/osm-map/blob/master/osm-map.html#L166. This causes repetition of elements in layers array every time `updateLayers` function is called.\r\n\r\nPossible solutions:\r\n\r\n1. Change `this.layers = []` to `this.layers.length = 0`. It looks like read only variables cannot be resetted but updated.\r\n2. Remove `readOnly: true`?\r\n3. Change `this.layers = []` to `this._setLayers([])`\r\n"}}