{"action":"opened","issue":{"url":"https://api.github.com/repos/openlayers/ol3/issues/3862","labels_url":"https://api.github.com/repos/openlayers/ol3/issues/3862/labels{/name}","comments_url":"https://api.github.com/repos/openlayers/ol3/issues/3862/comments","events_url":"https://api.github.com/repos/openlayers/ol3/issues/3862/events","html_url":"https://github.com/openlayers/ol3/issues/3862","id":92376320,"number":3862,"title":"assert errors on layers with empty features array.","user":{"login":"Rascaile","id":4179769,"avatar_url":"https://avatars.githubusercontent.com/u/4179769?v=3","gravatar_id":"","url":"https://api.github.com/users/Rascaile","html_url":"https://github.com/Rascaile","followers_url":"https://api.github.com/users/Rascaile/followers","following_url":"https://api.github.com/users/Rascaile/following{/other_user}","gists_url":"https://api.github.com/users/Rascaile/gists{/gist_id}","starred_url":"https://api.github.com/users/Rascaile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rascaile/subscriptions","organizations_url":"https://api.github.com/users/Rascaile/orgs","repos_url":"https://api.github.com/users/Rascaile/repos","events_url":"https://api.github.com/users/Rascaile/events{/privacy}","received_events_url":"https://api.github.com/users/Rascaile/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-01T13:00:50Z","updated_at":"2015-07-01T13:00:50Z","closed_at":null,"body":"Today I upgraded from openlayers version 3.5 to 3.6, and it suddenly started throwing the following error:\r\n\r\n    Uncaught AssertionError: Failure: unexpected layer configuration\r\n\r\nIt seems to be thrown right after I add a Vector layer with an empty source array to the map.\r\nThe trace from the error does not go all the way back to `addLayer()` so I assume it gets thrown when openlayers tries to render the map into the canvas (but it's only thrown once after adding such a layer) for the first time.\r\n\r\nIt's also thrown when I try to call `map.forEachFeatureAtPixel` with these vector layers on the map.\r\n\r\nThe errors disappear when I create a check to only add a layer if its source contains at least some elements, but this is not an elegant permanent solution as these points are defined by the users of our system (users can create custom points on our maps and save them). So to make this work I'd need to remove and add the layer whenever the first point is added or the last is deleted (granted, not a big issue, but still!). It's also not logical a layer like this -needs- to have features, if there are 0 features, there's no need to render them, so why throw an error? (that's my logic at least).\r\n\r\nI couldn't find anything relevant in the changelog, at least not at first glance without digging into each separate issue, so this might be a side effect of some other changes.\r\n\r\nI'll update with relevant information as I find it.\r\n\r\nThanks for your time.\r\nRascaile"}}