[OpenLayers-Trac] Re: [OpenLayers] #2965: Add halos to vector labels

OpenLayers trac-20090302 at openlayers.org
Sat Mar 17 06:37:18 EDT 2012


#2965: Add halos to vector labels
----------------------+-----------------------------------------------------
 Reporter:  rdewit    |       Owner:                  
     Type:  feature   |      Status:  new             
 Priority:  minor     |   Milestone:  2.13 Release    
Component:  Renderer  |     Version:  2.10            
 Keywords:            |       State:  Needs Discussion
----------------------+-----------------------------------------------------

Comment(by DonaldKerr):

 Replying to [comment:11 rdewit]:
 > Don't expect to get it in 2.12 though. I'm still waiting for some IE
 wizard to step up to fix the font problem.


 Buggy IE VML: Styles on both shape and textpath don't behave well at all
 when  using javascript.

 '''A solution to the font problem''': The only way I have found this to
 work was specifying it in textpath.style.font. This doesn't behave as
 documented ([http://msdn.microsoft.com/en-
 us/library/bb264023(v=vs.85).aspx]) as not all values can be changed with
 script. This specifies the order as "font-style, font-variant, font-
 weight, font-size, line-height, and font-family." - Don't believe it as
 they don't all work and it's quite quirky.

 Change the line where you set the fontSize (default 10 or whatever's
 specified in the style) from:

 {{{
 textpath.style.fontSize = style.fontSize || 10;
 }}}

 to:

 {{{
 textpath.style.font = "10 "+style.fontFamily;
 if (style.fontSize) {
     textpath.style.fontSize = style.fontSize;
 }
 }}}

 The default of 10 is applied whether or not the fontFamily is passed from
 the style. If the fontFamily is specified then that too is applied.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/2965#comment:24>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list