[OpenLayers-Users] problem labeling vector features - vertices
being labeled too
Michael Anderson
mike at spatialit.com
Wed Aug 19 09:56:12 EDT 2009
Hello,
I'm having a problem with labeling vector features. It works fine until I
select a feature with a ModifyFeature control. Then it labels all the
vertices as well as the feature itself. And they are all labeled 'undefined'
because the vertices don't have the attributes needed for the label.
I have a stylemap set up with 'default' and 'select' styles. Only the
default style has a label defined. At first I had a label set up for the
select style too so it would be labeled when selected. Then when the
vertices were labeled I removed the label from the style, but the vertices
are still labeled.
Is there a way to label a feature while it's vertices are visible and not
have the vertices labeled too? And I expected the select style to replace
the default one when the feature was selected. But it seems like they are
being combined since a selected feature has labels even when the select
style doesn't define one.
I've attached a simplified example. When it loads you will see the feature
with a label "1". Click on it to select it and the vertices will be labeled
with "undefined". The page is also available here:
http://128.118.7.3/testing/testlabel.html
Mike
More information about the Users
mailing list