{"action":"created","issue":{"url":"https://api.github.com/repos/openlayers/ol3/issues/4695","labels_url":"https://api.github.com/repos/openlayers/ol3/issues/4695/labels{/name}","comments_url":"https://api.github.com/repos/openlayers/ol3/issues/4695/comments","events_url":"https://api.github.com/repos/openlayers/ol3/issues/4695/events","html_url":"https://github.com/openlayers/ol3/issues/4695","id":127696926,"number":4695,"title":"getTileUrlFunction() returns unbinded function","user":{"login":"gberaudo","id":7294662,"avatar_url":"https://avatars.githubusercontent.com/u/7294662?v=3","gravatar_id":"","url":"https://api.github.com/users/gberaudo","html_url":"https://github.com/gberaudo","followers_url":"https://api.github.com/users/gberaudo/followers","following_url":"https://api.github.com/users/gberaudo/following{/other_user}","gists_url":"https://api.github.com/users/gberaudo/gists{/gist_id}","starred_url":"https://api.github.com/users/gberaudo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gberaudo/subscriptions","organizations_url":"https://api.github.com/users/gberaudo/orgs","repos_url":"https://api.github.com/users/gberaudo/repos","events_url":"https://api.github.com/users/gberaudo/events{/privacy}","received_events_url":"https://api.github.com/users/gberaudo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openlayers/ol3/labels/pull%20request%20accepted","name":"pull request accepted","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-20T14:42:34Z","updated_at":"2016-01-20T15:14:55Z","closed_at":null,"body":"By default, the function returned by `source.getTileUrlFunction()` used to be binded to the source.\r\nIt is no longer the case since https://github.com/openlayers/ol3/pull/4673, at least for TileWMS sources.\r\n\r\nIn the call `source.getTileUrlFunction()(...)`, `this` equals the `Window` object.\r\nIs it expected behavior?"},"comment":{"url":"https://api.github.com/repos/openlayers/ol3/issues/comments/173234208","html_url":"https://github.com/openlayers/ol3/issues/4695#issuecomment-173234208","issue_url":"https://api.github.com/repos/openlayers/ol3/issues/4695","id":173234208,"user":{"login":"gberaudo","id":7294662,"avatar_url":"https://avatars.githubusercontent.com/u/7294662?v=3","gravatar_id":"","url":"https://api.github.com/users/gberaudo","html_url":"https://github.com/gberaudo","followers_url":"https://api.github.com/users/gberaudo/followers","following_url":"https://api.github.com/users/gberaudo/following{/other_user}","gists_url":"https://api.github.com/users/gberaudo/gists{/gist_id}","starred_url":"https://api.github.com/users/gberaudo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gberaudo/subscriptions","organizations_url":"https://api.github.com/users/gberaudo/orgs","repos_url":"https://api.github.com/users/gberaudo/repos","events_url":"https://api.github.com/users/gberaudo/events{/privacy}","received_events_url":"https://api.github.com/users/gberaudo/received_events","type":"User","site_admin":false},"created_at":"2016-01-20T15:14:55Z","updated_at":"2016-01-20T15:14:55Z","body":"There are several places where the tileUrlFunction is changed so we might lose the binding in some cases. For example https://github.com/openlayers/ol3/blob/master/src/ol/source/urltilesource.js#L187-L188 we might get an unbinded version of `this.fixedTileUrlFunction`.\r\n\r\nAs a generalization of what you suggested in https://github.com/openlayers/ol3/issues/4695#issuecomment-173229514, I can also bind the above case and all the other references to `this.fixedTileUrlFunction`. Would it be good for you?"}}