Lazily create ol.defaultFeatureStyleFunction #1815

Merged
merged 1 commit into from Mar 12, 2014

Projects

None yet

2 participants

@austinhyde
Contributor

Besides the slight performance benefit of not prerendering the default
circle style until we need to, this change also allows loading OL3
in browsers that don't support the canvas API (IE 7-8). If the circle
style is rendered on load, the lack of HTMLCanvasElement#getContext
causes IE 7-8 to bomb, regardless of if vector styles are used at all.

@austinhyde austinhyde Lazily create ol.defaultFeatureStyleFunction
Besides the slight performance benefit of not prerendering the default
circle style until we need to, this change also allows loading OL3
in browsers that don't support the canvas API (IE 7-8). If the circle
style is rendered on load, the lack of HTMLCanvasElement#getContext
causes IE 7-8 to bomb, regardless of if vector styles are used at all.
0e21d2c
@tschaub
Member
tschaub commented Mar 12, 2014

Thanks for this fix @austinhyde. I think we'll need another solution for IE support before long, but this looks like a sensible workaround to me.

@tschaub tschaub merged commit c2400f6 into openlayers:master Mar 12, 2014

1 check passed

default The Travis CI build passed
Details
@austinhyde austinhyde deleted the Intermedix:lazy-style-function branch Mar 12, 2014
@austinhyde
Contributor

Thanks, Tim. I am indeed working on bigger solution for SVG/VML support in general, but it's a much bigger change and alters a lot of the rendering logic, so in the mean time, I'm just tidying up as you go.

@fredj fredj added a commit to fredj/openlayers that referenced this pull request Aug 31, 2015
@fredj fredj Use a private variable to cache the default style array
See #1815
Fixes #4063
bb6bc65
@fredj fredj added a commit to fredj/openlayers that referenced this pull request Sep 2, 2015
@fredj fredj Use a private variable to cache the default style array
See #1815
Fixes #4063
7f23678
@fredj fredj added a commit to fredj/openlayers that referenced this pull request Sep 7, 2015
@fredj fredj Use a private variable to cache the default style array
See #1815
Fixes #4063
5371d8d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment