Skip to content

Allow reuse of layer rendering code without creating a map #3215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 9, 2015
Merged

Allow reuse of layer rendering code without creating a map #3215

merged 8 commits into from
Feb 9, 2015

Conversation

tschaub
Copy link
Member

@tschaub tschaub commented Feb 8, 2015

This is part of an effort to make the layer rendering code a bit more reusable. For the most part, layer rendering methods are provided what they need in the frame state, and they do not need access to a map or a map renderer.

Previously, the layer renderer's image loading handler would call map.render() directly. Now layer renderers are observable and they fire a change event on image load (if otherwise ready).

The WebGL layer renderers can be refactored to be given an ol.webgl.Context instead of a map renderer. This would replace all calls to mapRenderer.getContext() and mapRenderer.getGL() within the layer renderers. However, the WebGL tile layer renderer is still tied to the map renderer through its use of the tile texture queue and cache. If someone was motivated to change this, the tile renderer could be passed the queue and cache instead of maintaining a reference to the map renderer to access them. Until then the WebGL layer renderers are a special case in that they need a reference to a map renderer.

@tschaub tschaub changed the title Rendering Allow reuse of layer rendering code without creating a map Feb 8, 2015
@elemoine
Copy link
Member

elemoine commented Feb 8, 2015

Good changes. Looking forward to reworking the WebGL renderer. Please merge.

tschaub added a commit that referenced this pull request Feb 9, 2015
Allow reuse of layer rendering code without creating a map.
@tschaub tschaub merged commit ada6b56 into openlayers:master Feb 9, 2015
@tschaub tschaub deleted the rendering branch February 9, 2015 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants