{"action":"created","issue":{"url":"https://api.github.com/repos/openlayers/ol3/issues/2683","labels_url":"https://api.github.com/repos/openlayers/ol3/issues/2683/labels{/name}","comments_url":"https://api.github.com/repos/openlayers/ol3/issues/2683/comments","events_url":"https://api.github.com/repos/openlayers/ol3/issues/2683/events","html_url":"https://github.com/openlayers/ol3/issues/2683","id":41979863,"number":2683,"title":"Reloading a vector source when URL changes","user":{"login":"acanimal","id":732033,"avatar_url":"https://avatars.githubusercontent.com/u/732033?v=3","gravatar_id":"","url":"https://api.github.com/users/acanimal","html_url":"https://github.com/acanimal","followers_url":"https://api.github.com/users/acanimal/followers","following_url":"https://api.github.com/users/acanimal/following{/other_user}","gists_url":"https://api.github.com/users/acanimal/gists{/gist_id}","starred_url":"https://api.github.com/users/acanimal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acanimal/subscriptions","organizations_url":"https://api.github.com/users/acanimal/orgs","repos_url":"https://api.github.com/users/acanimal/repos","events_url":"https://api.github.com/users/acanimal/events{/privacy}","received_events_url":"https://api.github.com/users/acanimal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-09-04T20:13:13Z","updated_at":"2015-05-08T20:19:52Z","closed_at":null,"body":"Hi,\r\nfollowing Bart's recommendation I open this ticket so the issue can be commented.\r\n\r\nIt starts with https://groups.google.com/forum/#!topic/ol3-dev/PjFBy5mxwgo and https://groups.google.com/forum/#!topic/ol3-dev/H6tZaFUUO4E topics on the forum.\r\n\r\nOnce a vector layer with its source pointing to some URL is created, there is no way to update the layer (really the source) content other than loading, cleaning and adding new features by hand.\r\n\r\nAlthough manually loading is the most flexible option, I think it is a bit confusing. I a user loads data initially setting an `url` property, why we need to load content manually if we want update the source?\r\n\r\nIt could be easy to have a `setUrl()` that updates the `url`property and invokes the `loadFeaturesFromURL()` method.\r\n\r\nAny opinions?\r\n\r\nPS: I offer as voluntary to make the code changes. But I don't know when I have enough free time :)\r\n\r\n<bountysource-plugin>\r\n\r\n---\r\nWant to back this issue? **[Place a bounty on it!](https://www.bountysource.com/issues/4218070-reloading-a-vector-source-when-url-changes?utm_campaign=plugin&utm_content=tracker%2F79013&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F79013&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/openlayers/ol3/issues/comments/100351201","html_url":"https://github.com/openlayers/ol3/issues/2683#issuecomment-100351201","issue_url":"https://api.github.com/repos/openlayers/ol3/issues/2683","id":100351201,"user":{"login":"akrherz","id":210858,"avatar_url":"https://avatars.githubusercontent.com/u/210858?v=3","gravatar_id":"","url":"https://api.github.com/users/akrherz","html_url":"https://github.com/akrherz","followers_url":"https://api.github.com/users/akrherz/followers","following_url":"https://api.github.com/users/akrherz/following{/other_user}","gists_url":"https://api.github.com/users/akrherz/gists{/gist_id}","starred_url":"https://api.github.com/users/akrherz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akrherz/subscriptions","organizations_url":"https://api.github.com/users/akrherz/orgs","repos_url":"https://api.github.com/users/akrherz/repos","events_url":"https://api.github.com/users/akrherz/events{/privacy}","received_events_url":"https://api.github.com/users/akrherz/received_events","type":"User","site_admin":false},"created_at":"2015-05-08T20:19:52Z","updated_at":"2015-05-08T20:19:52Z","body":"@elemoine when I call `source.clear(true);` in your example, this causes the source to load the data.  So the code example loads the data twice."}}