{"action":"created","issue":{"url":"https://api.github.com/repos/openlayers/ol3/issues/4516","labels_url":"https://api.github.com/repos/openlayers/ol3/issues/4516/labels{/name}","comments_url":"https://api.github.com/repos/openlayers/ol3/issues/4516/comments","events_url":"https://api.github.com/repos/openlayers/ol3/issues/4516/events","html_url":"https://github.com/openlayers/ol3/issues/4516","id":120399895,"number":4516,"title":"Transform projection for VectorTile rendering in VectorTile layer","user":{"login":"JWGmeligMeyling","id":3469492,"avatar_url":"https://avatars.githubusercontent.com/u/3469492?v=3","gravatar_id":"","url":"https://api.github.com/users/JWGmeligMeyling","html_url":"https://github.com/JWGmeligMeyling","followers_url":"https://api.github.com/users/JWGmeligMeyling/followers","following_url":"https://api.github.com/users/JWGmeligMeyling/following{/other_user}","gists_url":"https://api.github.com/users/JWGmeligMeyling/gists{/gist_id}","starred_url":"https://api.github.com/users/JWGmeligMeyling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JWGmeligMeyling/subscriptions","organizations_url":"https://api.github.com/users/JWGmeligMeyling/orgs","repos_url":"https://api.github.com/users/JWGmeligMeyling/repos","events_url":"https://api.github.com/users/JWGmeligMeyling/events{/privacy}","received_events_url":"https://api.github.com/users/JWGmeligMeyling/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-12-04T13:18:18Z","updated_at":"2015-12-04T13:52:44Z","closed_at":"2015-12-04T13:28:32Z","body":"I found out that the transformation is not passed to the loader for transforming the JSON data. (See https://github.com/openlayers/ol3/blob/2f06d214f5ead84f3119f2ffa1867a97c0ccd7e9/src/ol/vectortile.js#L141). In order to set it, I had to come up with the following:\r\n\r\n```js\r\n\tfunction TransformedTile() { ol.VectorTile.apply(this, arguments); }\r\n\tol.inherits(TransformedTile, ol.VectorTile);\r\n\tTransformedTile.prototype.load = function() {\r\n\t\tif (this.state == ol.TileState.IDLE) {\r\n\t\t\tthis.setState(ol.TileState.LOADING);\r\n\t\t\tthis.tileLoadFunction_(this, this.url_);\r\n\t\t\tthis.loader_(null, NaN, 'EPSG:3857');\r\n\t\t}\r\n\t};\r\n```\r\n\r\nAnd:\r\n```js\r\nnew ol.layer.VectorTile({\r\n  source: new ol.source.VectorTile({\r\n   format: new ol.format.GeoJSON({\r\n    defaultDataProjection: \"dataprojection\"\r\n  }),\r\n  tileClass: TransformedTile\r\n});\r\n```\r\n\r\nShouldn't the VectorTile API be modified slightly for easier access to the projection on the loader?"},"comment":{"url":"https://api.github.com/repos/openlayers/ol3/issues/comments/161972803","html_url":"https://github.com/openlayers/ol3/issues/4516#issuecomment-161972803","issue_url":"https://api.github.com/repos/openlayers/ol3/issues/4516","id":161972803,"user":{"login":"JWGmeligMeyling","id":3469492,"avatar_url":"https://avatars.githubusercontent.com/u/3469492?v=3","gravatar_id":"","url":"https://api.github.com/users/JWGmeligMeyling","html_url":"https://github.com/JWGmeligMeyling","followers_url":"https://api.github.com/users/JWGmeligMeyling/followers","following_url":"https://api.github.com/users/JWGmeligMeyling/following{/other_user}","gists_url":"https://api.github.com/users/JWGmeligMeyling/gists{/gist_id}","starred_url":"https://api.github.com/users/JWGmeligMeyling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JWGmeligMeyling/subscriptions","organizations_url":"https://api.github.com/users/JWGmeligMeyling/orgs","repos_url":"https://api.github.com/users/JWGmeligMeyling/repos","events_url":"https://api.github.com/users/JWGmeligMeyling/events{/privacy}","received_events_url":"https://api.github.com/users/JWGmeligMeyling/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T13:52:44Z","updated_at":"2015-12-04T13:52:44Z","body":"Thanks a ton! I think you're example really gets me started. The selection behaviour for the VectorTile makes sense. How would the code from the example behave? Would it also create two features for two features of the same id?"}}