[OpenLayers-Trac] Re: [OpenLayers] #3249: style.label.split is not
a function
OpenLayers
trac-20090302 at openlayers.org
Wed Apr 6 18:24:29 EDT 2011
#3249: style.label.split is not a function
--------------------------+-------------------------------------------------
Reporter: stricsc | Owner: tschaub
Type: bug | Status: assigned
Priority: major | Milestone: 2.11 Release
Component: Layer.Vector | Version: 2.10
Keywords: | State: Review
--------------------------+-------------------------------------------------
Changes (by tschaub):
* owner: crschmidt => tschaub
* status: new => assigned
Comment:
The alt patch casts to string in {{{style.createSymbolizer}}}. Here's the
difference:
With the first patch (cast in renderers) we are very safe, never calling
split unless we know we have a string. This means people can use the
(API) {{{layer.drawFeature}}} method and pass a "style" like this
{{{{label: 123}}}} and things still work.
However, if we tell people who are using the {{{drawFeature}}} method
directly that the label member of a symbolizer must have a string value,
then we don't need to be so conservative. We only need to cast to a
string when we create a symbolizer given a feature. This covers cases
where a label value might come from a numeric attribute.
I'm fine with either, but I like the less conservative patch (alt patch
with cast in Style.js) better because we need to get people to stop
calling {{{layer.drawFeature}}} directly anyway.
--
Ticket URL: <http://trac.openlayers.org/ticket/3249#comment:4>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list