[OpenLayers-Users] Label mis-align with IE9

Frank Broniewski brfr at metrico.lu
Mon May 30 09:54:05 EDT 2011


Hi all,

I noticed a problem with the label align in IE9. I have a style as follows:
var defaultStyle = new OpenLayers.Style(
     {
         'pointRadius' : '${radius}',
         'fillColor' : '#ff8200',
         'fillOpacity' : 1,
         'strokeColor' : '#fff',
         'strokeWidth' : 2,
         'cursor' : 'pointer',
         'label' : '${label}',
         'labelAlign' : 'cm',
         'fontColor' : 'white',
         'fontFamily' : 'sans-serif',
         'fontSize' : '12px',
         'fontWeight' : 'bold'

     },
     {
         'context' : {
             'radius' : function(feature) {
                 if (feature.attributes.count > 1) {
                     return 8;
                 } else if (feature.attributes.count == 1) {
                     // check for custom num_clients attribute
                     if (feature.cluster[0].attributes.num_clients &&
                         feature.cluster[0].attributes.num_clients > 1) {
                             return 8;
                     }
                 }
                 return 6;
             },
             'label' : function(feature) {
                 if (feature.attributes.count > 1) {
                     return feature.attributes.count;
                 } else if (feature.cluster[0].attributes.num_clients &&
                            feature.cluster[0].attributes.num_clients > 1) {
                                 return 
feature.cluster[0].attributes.num_clients;
                 }
                 return '';
             }
         }
     }
);

It's a stylemap on a clustered vector layer and the label is misaligned 
in IE9, it's not in center-middle as it is with firefox or other 
browsers. Is this a known problem with IE? I suppose this is SVG 
related, so I really have no clue what I can do. I'm using OL 2.10 ...
You can visit http://viaah.lu/adresse/clervaux/clervaux/streets/3/ for 
an example


Many thanks

Frank



-- 
Frank BRONIEWSKI

METRICO s.à r.l.
géomètres
technologies d'information géographique
rue des Romains 36
L-5433 NIEDERDONVEN

tél.: +352 26 74 94 - 28
fax.: +352 26 74 94 99
http://www.metrico.lu


More information about the Users mailing list