[OpenLayers-Users] Text labels

Nicholas Efremov-Kendall n.e.kendall at gmail.com
Tue Sep 29 05:12:06 EDT 2009


Hi all,
Sorry to bug you all with a pretty simple question. I have a shp file
converted to GML, with an attribute called "name." I'd like for this to be
places as a label by the polygon feature. I think, based on my digging
around on the lists that I need a function to first get the
feature.attributes.Name, which would then pass it to the label. Does anyone
have a good example of this, or suggestions on implementation?

var cities = new OpenLayers.Layer.GML ("7th Century Cities",
"data/cities.gml",
{
style: {strokeWidth:1, strokeColor:"#CCCCCC", fillColor: "green"},
projection: new OpenLayers.Projection("EPSG:4326"),
format: OpenLayers.Format.GML,

  label: "$name",


}
);
map.addLayer(cities);


-- 
Nicholas Efremov-Kendall
Fulbright Student 2009-2010, Ukraine
nefremov at artsci.wustl.edu
c/o Halyna Yerko
Balzaka 92a, Kv 27
02232
Kyiv, Ukraine
(mob) +380963576524
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090929/1fd30e44/attachment.html


More information about the Users mailing list