Das hatte ich bereits versucht, aber mehr als “undefined” kommt dabei leider nicht raus… :slight_smile:


styleMap: new OpenLayers.StyleMap
        (
            {
                'default':
                {
                    externalGraphic: '${icon}.png',
                    graphicWidth: 26,
                    graphicHeight: 26
                },
                
                'select':
                {
                    backgroundGraphic: 'bg.png',
                    backgroundHeight: 20,
                    backgroundWidth: '${getBackgroundWidth}',
                    backgroundYOffset: 15,
                    label: '${ziel}',
                    labelYOffset: -30,
                    labelAlign: 'cb',
                    fontFamily: 'Arial',
                    fontSize: 15,
                    cursor: 'pointer'
                },
                
                'context':
                {
                    getBackgroundWidth: function(feature)
                    {
                        return(5 * feature.attributes.ziel.length);
                    }
                }
            }
        )

Gruß Wayne