Hi Arnd
 
Many thanks - that's what I needed. This is what worked:
 
var padd_style2 = new OpenLayers.StyleMap({
    "default": new OpenLayers.Style(
        {
            pointRadius: 3,
            strokeColor: "#ff9933",
            fillColor: "#ffcc66",
            fillOpacity: 0.2,
            strokeWidth: 2,
            //label: "${name}",
            fontColor: "blue",
            fontSize: 10,
            fontFamily: "Arial",
            fontWeight: "bold"
        },
        // the second argument will include all rules
        {
            rules: [
                new OpenLayers.Rule({
                    // a rule contains an optional filter
                    filter: new OpenLayers.Filter.Comparison({
                        type: OpenLayers.Filter.Comparison.EQUAL_TO,
                        property: "name", 
                        value: undefined
                    }),
                    // if a feature matches the above filter, use this 
symbolizer
                    symbolizer: {
                        label: null
                    }
                }),
                new OpenLayers.Rule({
                    filter: new OpenLayers.Filter.Comparison({
                        type: OpenLayers.Filter.Comparison.NOT_EQUAL_TO,
                        property: "name",
                        value: undefined
                    }),
                    symbolizer: {
                        label: "${name}"
                    }
                })
            ]
        }
      )
    });

Robert
>>> "Arnd Wippermann" <[email protected]> 11/11/2010 6:04 a.m. >>>
Hi,
that should help:
http://osgeo-org.1803224.n2.nabble.com/undefined-at-vertices-while-editing-vector-layer-td5478330.html
 
 
Arnd

 
Von: [email protected] 
[mailto:[email protected]] Im Auftrag von Robert Sanson
Gesendet: Mittwoch, 10. November 2010 00:58
An: [email protected] 
Betreff: [OpenLayers-Users] ModifyFeature control - how to turn offlabelling?

Hi
 
I have a Vector POLYGON layer loaded from a WKT. The layer's styleMap includes 
a label based on one of the Attributes. I have a ModifyFeature control added to 
the layer. When I select a Polygon for editing, it labels all of the vertices 
with "undefined". How can I turn this off?
 
My styleMap is:
 
var padd_style = new OpenLayers.StyleMap({"default": new OpenLayers.Style({
      "strokeWidth":3,
      "strokeColor":"#ff0000",
      "fillOpacity":0.25,
      "pointRadius":2,
      label : "${name}",
      fontColor: "blue",
      fontSize: 10,
      fontFamily: "Arial",
      fontWeight: "bold"})
  });
 
Many thanks,
 
Robert Sanson



This email and any attachments are confidential and intended solely for the 
addressee(s). If you are not the intended recipient, please notify us 
immediately and then delete this email from your system.
This message has been scanned for Malware and Viruses by Websense Hosted 
Security. www.websense.com ( http://www.websense.com/ )


Click here ( 
https://www.mailcontrol.com/sr/YnG+CyGoUS!TndxI!oX7Ul4TPWxlZJ1alb2Agqc9c53mj5fYarcaKEFQjoiICXdX9krI7kcezdSUUtXYzJog3g==
 ) to report this email as spam.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to