{"action":"created","issue":{"url":"https://api.github.com/repos/openlayers/ol3/issues/3515","labels_url":"https://api.github.com/repos/openlayers/ol3/issues/3515/labels{/name}","comments_url":"https://api.github.com/repos/openlayers/ol3/issues/3515/comments","events_url":"https://api.github.com/repos/openlayers/ol3/issues/3515/events","html_url":"https://github.com/openlayers/ol3/issues/3515","id":66979952,"number":3515,"title":"The readFeatures (et al.) methods of feature formats should accept a string","user":{"login":"tschaub","id":41094,"avatar_url":"https://avatars.githubusercontent.com/u/41094?v=3","gravatar_id":"","url":"https://api.github.com/users/tschaub","html_url":"https://github.com/tschaub","followers_url":"https://api.github.com/users/tschaub/followers","following_url":"https://api.github.com/users/tschaub/following{/other_user}","gists_url":"https://api.github.com/users/tschaub/gists{/gist_id}","starred_url":"https://api.github.com/users/tschaub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschaub/subscriptions","organizations_url":"https://api.github.com/users/tschaub/orgs","repos_url":"https://api.github.com/users/tschaub/repos","events_url":"https://api.github.com/users/tschaub/events{/privacy}","received_events_url":"https://api.github.com/users/tschaub/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-07T20:09:43Z","updated_at":"2015-04-07T21:21:15Z","closed_at":"2015-04-07T21:16:53Z","body":"Currently, we say that `ol.format.Feature#readFeatures` accepts `ArrayBuffer|Document|Node|Object|string`.  In practice though, it only works with one type, not any of the listed types.  This is particularly misleading, especially with the missing documentation for the type accepted (see for example the [`ol.format.GeoJSON#readFeatures` documentation](http://openlayers.org/en/master/apidoc/ol.format.GeoJSON.html#readFeatures) which says anything is accepted and doesn't give more detail - in fact, only an `Object` works).\r\n\r\nAs with the `writeFeatures` methods (which consistently return a string, see #2102), I think `readFeatures` should consistently accept a string.  The same should be true for `readFeature` and `readGeometry`.\r\n\r\nSince we can't make all of these methods accept all types (e.g. it doesn't make sense for `ol.format.GeoJSON#readFeatures` to accept `ArrayBuffer|Document|Node`), I think it would have been best to make them accept only `string`.  We could be strictly backwards compatible by adding support for `string` now and still accepting whatever else they currently do.\r\n"},"comment":{"url":"https://api.github.com/repos/openlayers/ol3/issues/comments/90736120","html_url":"https://github.com/openlayers/ol3/issues/3515#issuecomment-90736120","issue_url":"https://api.github.com/repos/openlayers/ol3/issues/3515","id":90736120,"user":{"login":"elemoine","id":76594,"avatar_url":"https://avatars.githubusercontent.com/u/76594?v=3","gravatar_id":"","url":"https://api.github.com/users/elemoine","html_url":"https://github.com/elemoine","followers_url":"https://api.github.com/users/elemoine/followers","following_url":"https://api.github.com/users/elemoine/following{/other_user}","gists_url":"https://api.github.com/users/elemoine/gists{/gist_id}","starred_url":"https://api.github.com/users/elemoine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elemoine/subscriptions","organizations_url":"https://api.github.com/users/elemoine/orgs","repos_url":"https://api.github.com/users/elemoine/repos","events_url":"https://api.github.com/users/elemoine/events{/privacy}","received_events_url":"https://api.github.com/users/elemoine/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T21:21:15Z","updated_at":"2015-04-07T21:21:15Z","body":"What? Did you miss that the readFeatures methods do accept strings currently? But still, having Node and Document in the signature of ol.format.GeoJSON#readFeatures doesn't make sense to me. "}}