Ok Carlos.. I&#39;ll take a look.. Thanks a lot!<br><br><div class="gmail_quote">2012/2/17 Carlos Krefft <span dir="ltr">&lt;<a href="mailto:ckrefft@rsmas.miami.edu">ckrefft@rsmas.miami.edu</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">You can create two images for your features one with background color red and one with green. Then switch the graphics dynamically.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">If (I need redbackground){<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">       myfeatureStyle.externalGraphic: imgRedBackground;<u></u><u></u></span></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">}else{<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">      myfeatureStyle.externalGraphic: imgGreenBackground;<u></u><u></u></span></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">}<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">OR:<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">       <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">You can also not use graphics and use the basic feature point symbology such as a circle, square, X and so on. This way you can change the color dynamically to any color you want without having premade graphic images made out.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">This is an example of two point features symbolized as circles with a numeric label. (no externalGraphic).<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><img width="285" height="183"></span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> jkm [mailto:<a href="mailto:rifins@gmail.com" target="_blank">rifins@gmail.com</a>] <br>
<b>Sent:</b> Friday, February 17, 2012 12:53 PM</span></p><div><div class="h5"><br><b>To:</b> Carlos Krefft<br><b>Cc:</b> <a href="mailto:users@openlayers.org" target="_blank">users@openlayers.org</a><br><b>Subject:</b> Re: [OpenLayers-Users] Drawing a point feature with image and background color..<u></u><u></u></div>
</div><p></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Ohps sorry! You are right! I made a confusing question.. <u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div>
<div><p class="MsoNormal">What I would like.. is draw only one feature.. <u></u><u></u></p></div><div><p class="MsoNormal">This feature should represent the kind of item (represented by the externalGraphic) and how much critical is the item (represented by background color from green to red).. <u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">By now, i&#39;m drawing in two separate features on the same position (One with externalgraphic, and the other with fillColor).. But I&#39;m doing in this way, because i can&#39;t find the way to draw a unique feature..<u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">You can see that my english is not as good as i would like..  :)<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div>
<div><p class="MsoNormal">Thanks again..!<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">
<u></u> <u></u></p><div><p class="MsoNormal">2012/2/17 Carlos Krefft &lt;<a href="mailto:ckrefft@rsmas.miami.edu" target="_blank">ckrefft@rsmas.miami.edu</a>&gt;<u></u><u></u></p><div><div><p class="MsoNormal" style="margin-left:22.5pt">
“I&#39;m drawing features with images defined by the externalGraphic property.. Then.. I can&#39;t use the fillColor.. ?”<u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">You cannot use fillColor with an externalGraphic as it says in the documentation . But your original question states you will be using TWO features “I&#39;m drawing two elements in the same position”.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">So use fillColor for your background feature and externalGraphic for your foreground feature.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal" style="margin-left:22.5pt">“Or is there any other way to draw the feature withous using externalGraphic?”<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Yes, you can simply omit the externalGraphic and the feature will draw without the a graphic, just with the style.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Carlos K.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> jkm [mailto:<a href="mailto:rifins@gmail.com" target="_blank">rifins@gmail.com</a>] <br>
<b>Sent:</b> Friday, February 17, 2012 12:08 PM<br><b>To:</b> Carlos Krefft<br><b>Cc:</b> <a href="mailto:users@openlayers.org" target="_blank">users@openlayers.org</a><br><b>Subject:</b> Re: [OpenLayers-Users] Drawing a point feature with image and background color..</span><u></u><u></u></p>
<div><div><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Uhm..<u></u><u></u></p><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">But.. as seen in this link..<u></u><u></u></p></div>
<div><p class="MsoNormal"><a href="http://docs.openlayers.org/library/feature_styling.html" target="_blank">http://docs.openlayers.org/library/feature_styling.html</a> <u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p>
</div><div><p class="MsoNormal" style="text-align:justify;line-height:13.5pt;background:white"><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">&quot;fillColor</span><u></u><u></u></p><p style="margin-left:.5in;text-align:justify;line-height:13.5pt;background:white;margin-top:0px!important">
<span style="font-size:10.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">Default is </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;background:#ecf0f3">#ee9900</span><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">. This is the color used for filling in Polygons. It is also used in the center of marks for points: the interior color of circles or other shapes. It is not used if an externalGraphic is applied to a point.&quot;</span><u></u><u></u></p>
<div><p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">I&#39;m drawing features with images defined by the externalGraphic property.. Then.. I can&#39;t use the fillColor.. ?<u></u><u></u></p>
</div><div><p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">Or is there any other way to draw the feature withous using externalGraphic?<u></u><u></u></p>
</div><div><p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">Thanks...<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">
 <u></u><u></u></p></div><p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p><div><p class="MsoNormal" style="margin-left:22.5pt">2012/2/17 Carlos Krefft &lt;<a href="mailto:ckrefft@rsmas.miami.edu" target="_blank">ckrefft@rsmas.miami.edu</a>&gt;<u></u><u></u></p>
<div><div><p class="MsoNormal" style="margin-left:22.5pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Here are the possible values:</span><u></u><u></u></p><p class="MsoNormal" style="margin-left:22.5pt">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal" style="margin-left:22.5pt"><a href="http://docs.openlayers.org/library/feature_styling.html#style-properties" target="_blank">http://docs.openlayers.org/library/feature_styling.html#style-properties</a><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p><p class="MsoNormal" style="margin-left:22.5pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:22.5pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p><div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:22.5pt"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> <a href="mailto:openlayers-users-bounces@lists.osgeo.org" target="_blank">openlayers-users-bounces@lists.osgeo.org</a> [mailto:<a href="mailto:openlayers-users-bounces@lists.osgeo.org" target="_blank">openlayers-users-bounces@lists.osgeo.org</a>] <b>On Behalf Of </b>Carlos Krefft<br>
<b>Sent:</b> Friday, February 17, 2012 11:40 AM<br><b>To:</b> &#39;jkm&#39;; <a href="mailto:users@openlayers.org" target="_blank">users@openlayers.org</a><br><b>Subject:</b> RE: [OpenLayers-Users] Drawing a point feature with image and background color..</span><u></u><u></u></p>
</div></div><div><div><p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p><p class="MsoNormal" style="margin-left:22.5pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Use fillColor.</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:22.5pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">…</span><u></u><u></u></p><p class="MsoNormal" style="margin-left:22.5pt;text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas">fillColor: <span style="color:maroon">&quot;#FF5500&quot;</span>,</span><u></u><u></u></p><p class="MsoNormal" style="margin-left:22.5pt;text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas">fillOpacity: 0.7,</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:22.5pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">…</span><u></u><u></u></p><p class="MsoNormal" style="margin-left:22.5pt">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal" style="margin-left:22.5pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Carlos K.</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:22.5pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal" style="margin-left:22.5pt">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal" style="margin-left:22.5pt"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> <a href="mailto:openlayers-users-bounces@lists.osgeo.org" target="_blank">openlayers-users-bounces@lists.osgeo.org</a> <a href="mailto:[mailto:openlayers-users-bounces@lists.osgeo.org]" target="_blank">[mailto:openlayers-users-bounces@lists.osgeo.org]</a> <b>On Behalf Of </b>jkm<br>
<b>Sent:</b> Friday, February 17, 2012 5:58 AM<br><b>To:</b> <a href="mailto:users@openlayers.org" target="_blank">users@openlayers.org</a><br><b>Subject:</b> [OpenLayers-Users] Drawing a point feature with image and background color..</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p><p class="MsoNormal" style="margin-left:22.5pt">Hi, <u></u><u></u></p><div><p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">
I would like to know if it is possible to draw a point feature with a background color..<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">
I define a style like that:<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p></div><div><div><p class="MsoNormal" style="margin-left:22.5pt">ImgStyle = {<u></u><u></u></p></div>
<div><p class="MsoNormal" style="margin-left:22.5pt">        externalGraphic: imgURL,<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">        label: text,<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">
        labelXOffset: &quot;0&quot;,<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">        labelYOffset: &quot;-10&quot;,<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">
        fontColor: txt_colfont,<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">        fontSize: &quot;10px&quot;,<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">        fontFamily: &quot;Arial&quot;,<u></u><u></u></p>
</div><div><p class="MsoNormal" style="margin-left:22.5pt">        fontWeight: &quot;bold&quot;,<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">        pointRadius: 10,<u></u><u></u></p></div>
<div><p class="MsoNormal" style="margin-left:22.5pt">        labelAlign: &quot;cm&quot;,<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">        labelPadding: &quot;3px&quot;,<u></u><u></u></p>
</div><div><p class="MsoNormal" style="margin-left:22.5pt">        labelBackgroundColor: txt_colback,<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">        labelBorderColor: &quot;#cfcfcf&quot;,<u></u><u></u></p>
</div><div><p class="MsoNormal" style="margin-left:22.5pt">        labelBorderSize: &quot;1px&quot;<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">    };<u></u><u></u></p></div></div><div><p class="MsoNormal" style="margin-left:22.5pt">
 <u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">And what I would like to do, is draw a background to the image..<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p>
</div><div><p class="MsoNormal" style="margin-left:22.5pt">By now, I&#39;m drawing two elements in the same position, one is the point with the externalGraphic, and the other one is the same but without the externalGraphic and with a background color.. With this I can see the effect of a background under the image..<u></u><u></u></p>
</div><div><p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">But, I would like to draw as a unique element... Because I&#39;m loading a large amount of markers to the map.<u></u><u></u></p>
</div><div><p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">And also, I would like to apply a cluster strategy to the layer.. And drawing the background and the image as separate features modifies the clustering..<u></u><u></u></p>
</div><div><p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">Thanks!<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt">
 <u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p></div></div></div></div></div></div><p class="MsoNormal" style="margin-left:22.5pt"> <u></u><u></u></p></div></div></div></div>
</div></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></div></blockquote></div><br>