[OpenLayers-Users] Vector Layer - Partial Polygon Labelling

Donald Kerr donald.kerr at dkerr.co.uk
Sun Apr 8 04:38:39 EDT 2012


Is there a way to force a polygon label to display when only part of a
polygon is displayed?

I have a Mapserver WFS returning large area polygons with Openlayers
displaying those as vector polygon areas. When zoomed in, I want to be able
to label that part of the polygon that is showing on screen i.e. a label
that always appears despite the whole polygon not being displayed.

See attached example showing what I would like to achieve. This is an image
rendered by Mapserver. Using Openlayers, I can only show labels centered in
the polygon rather than at the edge when the whole Polygon is not displayed.
When only part of the polygon is displayed then no label appears.

I have tried a WMS request but this displays a label in each tile returned
(and partial labels at times). A WFS request, which is what I want to use,
just displays the label in the center.

Is it possible to achieve what I'm looking for?

Many thanks.

Regards,

Donald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PolygonLabelExample.gif
Type: image/gif
Size: 17052 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120408/f2d58874/PolygonLabelExample.gif


More information about the Users mailing list