[OpenLayers-Dev] KML LabelYOffset Style does not work in mobile

Manolo Quijano manolo.quijano at gmail.com
Fri Jan 25 09:10:18 PST 2013

Hi all,

       I have an issue when I try to show the label of the items  content
in a KML file.

      The piece of code is that:

         myStyles = new OpenLayers.StyleMap({
"default": new OpenLayers.Style({
label: "${name}",
labelYOffset: "24"

var kmlmedios = new OpenLayers.Layer.Vector("KML",{
styleMap: myStyles,
projection: map.displayProjection,
displayInLayerSwitcher: false,
                strategies: [new OpenLayers.Strategy.Fixed()],
visibility: true,

protocol: new OpenLayers.Protocol.HTTP({
url: "kml/medios.kml",
params: { 'key': Math.random()},
format: new OpenLayers.Format.KML({
extractStyles: true,
extractAttributes: true
renderers: renderer

kmlmedios.events.on({"beforefeatureadded": ActualizaEstilo});

       function ActualizaEstilo(evt){
var estilo;
estilo = evt.feature.layer.styleMap.createSymbolizer(evt.feature,"default");
 for (var campo in estilo){
evt.feature.style[campo] = estilo[campo];

      All work fine in Chrome, IE, FireFox, but in my Android 2.21 using
the WebBrowser by default, the  property labelYOffset does not work and the
label is shown in the middle of the associated icon

      I don't know how to debug the webpage in the phone (Samsung Galaxy
SCL - i9003) to find the bug.
      I'm working with OpenLayer 2.12

     Any workaround  to make it work ?

Thanks in advance,
Manolo Q.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20130125/268f142c/attachment.html>

More information about the Dev mailing list