{"action":"created","issue":{"url":"https://api.github.com/repos/openlayers/ol3-cesium/issues/139","labels_url":"https://api.github.com/repos/openlayers/ol3-cesium/issues/139/labels{/name}","comments_url":"https://api.github.com/repos/openlayers/ol3-cesium/issues/139/comments","events_url":"https://api.github.com/repos/openlayers/ol3-cesium/issues/139/events","html_url":"https://github.com/openlayers/ol3-cesium/issues/139","id":51314425,"number":139,"title":"OL-Cesium Layer Synchronization","user":{"login":"schmidtk","id":5685437,"avatar_url":"https://avatars.githubusercontent.com/u/5685437?v=3","gravatar_id":"","url":"https://api.github.com/users/schmidtk","html_url":"https://github.com/schmidtk","followers_url":"https://api.github.com/users/schmidtk/followers","following_url":"https://api.github.com/users/schmidtk/following{/other_user}","gists_url":"https://api.github.com/users/schmidtk/gists{/gist_id}","starred_url":"https://api.github.com/users/schmidtk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmidtk/subscriptions","organizations_url":"https://api.github.com/users/schmidtk/orgs","repos_url":"https://api.github.com/users/schmidtk/repos","events_url":"https://api.github.com/users/schmidtk/events{/privacy}","received_events_url":"https://api.github.com/users/schmidtk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2014-12-08T15:32:30Z","updated_at":"2015-01-08T14:46:43Z","closed_at":null,"body":"As a developer, it would be extremely useful to have more control over how ol3 layers are synchronized to Cesium. `olcs.VectorSynchronizer` and `olcs.RasterSynchronizer` make heavy use of closures to reuse a single synchronizer for every tile/vector layer, but this makes extending the class much more difficult.\r\n\r\nI discussed two solutions to this with @ahocevar and we decided on the less invasive approach to the current framework that would give application developers significantly more freedom in customizing layer synchronization. Below are my thoughts on implementation.\r\n\r\n`olcs.OLCesium` should have a root synchronizer implementing `olcs.ILayerSynchronizer` that can be overridden in the options to `olcs.OLCesium`. Replace the current `olcs.OLCesium` params with an options object containing the map, optional target, and optional layer synchronizer. The `olcs.ILayerSynchronizer` interface should have setters for the map/scene (or the `olcs.OLCesium`, since it has accessible references to both?) and a synchronize function, and the default synchronization class can create the existing `olcs.VectorSynchronizer` and `olcs.RasterSynchronizer`."},"comment":{"url":"https://api.github.com/repos/openlayers/ol3-cesium/issues/comments/69188368","html_url":"https://github.com/openlayers/ol3-cesium/issues/139#issuecomment-69188368","issue_url":"https://api.github.com/repos/openlayers/ol3-cesium/issues/139","id":69188368,"user":{"login":"ahocevar","id":211514,"avatar_url":"https://avatars.githubusercontent.com/u/211514?v=3","gravatar_id":"","url":"https://api.github.com/users/ahocevar","html_url":"https://github.com/ahocevar","followers_url":"https://api.github.com/users/ahocevar/followers","following_url":"https://api.github.com/users/ahocevar/following{/other_user}","gists_url":"https://api.github.com/users/ahocevar/gists{/gist_id}","starred_url":"https://api.github.com/users/ahocevar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahocevar/subscriptions","organizations_url":"https://api.github.com/users/ahocevar/orgs","repos_url":"https://api.github.com/users/ahocevar/repos","events_url":"https://api.github.com/users/ahocevar/events{/privacy}","received_events_url":"https://api.github.com/users/ahocevar/received_events","type":"User","site_admin":false},"created_at":"2015-01-08T14:46:43Z","updated_at":"2015-01-08T14:46:43Z","body":"See #147 for a possible solution, using a callback function like @gberaudo suggested. I also tried to implement something along the lines of @schmidtk's most recent suggestion, but that would have required major changes in the way synchronizers are initialized.\r\n\r\n@schmidtk, can you please see if #147 works for you?"}}