<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Once I have features with different attributes, the mechanisms
you describe would work, but I don't have any attributes in my features to
distinguish them by.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>The features are being created by the DrawFeature control.  And
it doesn't add any attributes to the features it creates. My problem is how to
have two different instances of the DrawFeature control add different
attributes to the features they create.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Currently, I've created my own control that adds an attribute to
the feature, based on an option passed when the control was created, and this
is working. But it seems a bit kludgy, and is likely to break if a future
version of OpenLayers makes changes to how DrawFeature.drawFeature() works.  So
I was wondering if there was a better way to do it.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> Pierre Giraud
[mailto:pierre.giraud@camptocamp.com] <br>
<b>Sent:</b> Tuesday, April 06, 2010 2:46 AM<br>
<b>To:</b> Jeff Dege<br>
<b>Cc:</b> users@openlayers.org<br>
<b>Subject:</b> Re: [OpenLayers-Users] Different types of polygons?<o:p></o:p></span></p>

</div>

<p class=MsoNormal style='margin-left:.5in'><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:.5in'>You can add a listener on the &quot;featureadded&quot;
event of your vector layer. In this listener callback function, you should be
able, for example, to set a specific value for an attribute of the added
feature. Then using a StyleMap on your layer you should be able to draw the
given feature with a specific color depending on the attribute value.<br>
<br>
I hope this helps.<br>
<br>
Pierre<o:p></o:p></p>

<div>

<p class=MsoNormal style='margin-left:.5in'>On Mon, Apr 5, 2010 at 11:26 PM,
Jeff Dege &lt;<a href="mailto:jeff.dege@korterra.com">jeff.dege@korterra.com</a>&gt;
wrote:<o:p></o:p></p>

<div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:.5in'>I find myself needing to draw two different kinds of polygons
on a Vector layer.&nbsp; First, they need to have different colors, and second,
they need to be processed differently when they are complete.<o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:.5in'>&nbsp;<o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:.5in'>I'm currently working on the first problem, and am playing
around with two DrawFeature controls.&nbsp; Right now, they behave the
same.&nbsp; I'm trying to find a way to hook into them, in some way, so I can
modify the features they create.<o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:.5in'>&nbsp;<o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:.5in'>Any ideas?<o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:.5in'>&nbsp;<o:p></o:p></p>

</div>

</div>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:.5in'><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-left:.5in'><br>
<br clear=all>
<br>
-- <br>
Pierre GIRAUD<br>
Géomaticien, Analyste<br>
<br>
Camptocamp France SAS<br>
Savoie Technolac, BP 352<br>
73377 Le Bourget du Lac, Cedex <br>
<br>
Tel : 00 33 4 79 44 44 93<br>
Mail : <a href="mailto:pierre.giraud@camptocamp.com">pierre.giraud@camptocamp.com</a><br>
<a href="http://www.camptocamp.com">http://www.camptocamp.com</a> &nbsp;<o:p></o:p></p>

</div>

</body>

</html>