[OpenLayers-Users] OpenLayers Patch Ticket #1895 Labels for vector features

Linda Rawson linda.rawson at gmail.com
Mon Feb 23 16:47:29 EST 2009


 I so applaud you!  I am just trying to implement your patch.

It does not seem to work on very small features.  That is exactly where I
need it to work.  Labels that do not show up until the user zooms into the
feature.

Add this to your .html.  It is a box.

pointList = [];
   pointList.push(new OpenLayers.Geometry.Point(-109.0839199, 45.7097772));
   pointList.push(new OpenLayers.Geometry.Point(-109.0222348, 45.7097772));
   pointList.push(new OpenLayers.Geometry.Point(-109.0222348, 45.6666019));
   pointList.push(new OpenLayers.Geometry.Point(-109.0839199, 45.6666019));
   pointList.push(new OpenLayers.Geometry.Point(-109.0839199, 45.7097772));
   linearRing = new OpenLayers.Geometry.LinearRing(pointList);
   polygonFeature = new OpenLayers.Feature.Vector(
                new OpenLayers.Geometry.Polygon([linearRing]));
          polygonFeature.attributes = {
              name: "box",
              age: 21,
              favColor: 'purple'
          };
            vectorLayer.addFeatures([polygonFeature]);

No label appears even when I zoom into where the box is at.

This is on both firefox and IE.

*hugs*

Linda Rawson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090223/326dca30/attachment.html


More information about the Users mailing list