problem with a layer label

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

problem with a layer label

boesiii
I have a line layer which I have added a label, the layer is loaded using a geojson file. I would like the position of the label to be the starting vertex of the line but for some reason the label is displaying at some odd distance from the starting vertex and as I zoom closer this distance changes.

Zoom Level 16


Zoom Level 18


StyleMap Code Below:

var pipe_anno_stylemap = new OpenLayers.StyleMap ({
                                'default': new OpenLayers.Style({
                                        strokeColor: "#34BF3F",
                    strokeWidth: 3,
                    strokeOpacity: 0.8,
                                        label : "${PIPE_DIAM}",
                                        fontColor: "black",
                                        fontSize: "12px",
                                        fontFamily: "Arial",
                                        fontWeight: "bold",
                                        labelAlign: "left",
                                        //strokeWidth: 0,
                                        labelXOffset: "${OFFSET_X}",
                                        labelYOffset: "${OFFSET_Y}",
                                        labelRotation: 45,
                                })
                        });