Not my code but Paul Spencer's. View the mail in its context, using the
link... Or here my version. Thanks.
var textLayer = new OpenLayers.Layer.Vector('text', {
style: new OpenLayers.Style({
label: '${label}', // this gets the value of the text
from the label
attribute of each feature
fontFamily: 'Arial',
fontSize: '12px',
fill: 'true', graphic: 'false',
labelXOffset: '${dX}', labelYOffset: '${dY}', // New
attributes for the
style
fontColor: '#001', // this could come from the feature
attributes too ...
pointRadius: 0 // this makes the point (normally a
small circle)
invisible
}) // Style has been defined
}); // Here one more } than in the original example given.
map.addLayer(textLayer);
//alert(OpenLayers.Number.format(lontick, 0,"")+"mE"); This works OK.
// Ref. http://trac.openlayers.org/ticket/1895,
http://dev.openlayers.org/docs/files/OpenLayers/BaseTypes-js.html#OpenLayers.Number.format
var NorthText = new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Point(lontick+0.,lattick+0.), //Northing
coordinate value on the top of the tick
{label: OpenLayers.Number.format(lontick, 0,"")+"mE", dX:0,
dY:50}, null
// feature attributes as the second parameter
);
textLayer.addFeatures([NorthText]); // Label placed.
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Text-markers-tp3143260p5555135.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users