-
Notifications
You must be signed in to change notification settings - Fork 21
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
Canvas renderer for large images #1319
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I found a bug... and I have one style suggestion. Let me know what you think.
features: ['quad'], | ||
autoshareRenderer: false, | ||
}); | ||
renderer: 'canvas', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this say webgl
here?
If yes, then I'd also recommend creating a boolean value (bigImage
or something like that) and using a ternary conditional expression right in the renderer
entry definition. This would avoid defining a default and then mutating it on (slightly) complex logic -- I think that would make the code more legible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, by default it didn't have a renderer and would default to webGL. I added in the default value and forgot to remove it.
I've updated to your suggestion, the formatting is caused by the annoying line length limit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only other thing I notice now is that you don't need the params
variable any longer--you can supply that object literal to geoViewer.value.createLayer()
directly.
Swaps the geoJS renderer from Webgl to Canvas when the image size exceeds 8192 (8k) in any dimension.
WebGL has a maximum texture size and this will allow larger images to be displayed in the renderer.