Alexandre,<br><br>thanks again for your help.<br><br>The
event is not triggered with the code you posted so I changed a few things
around, though it&#39;s probably not the best way to do this, and it seems
to be triggered:<div class="im"><br><br>
             var oDrawPoint = new OpenLayers.Control.DrawFeature(vectors, OpenLayers.Handler.Point);<br></div>             vectors.events.on({&#39;<div id=":1g7" class="ii gt">featureadded&#39;: onPointFeatureAdded, &#39;scope&#39;: oDrawPoint });<br>
                     <br>
             function onPointFeatureAdded (event) {<br>                 var feature = event.feature;<br>                 if (feature.geometry.CLASS_NAME == &#39;OpenLayers.Geometry.Point&#39;) {<br>                  <br>
                  var symbolizer = feature.layer.styleMap.createSymbolizer(feature);<div class="im"><br>
                  feature.style = symbolizer;<br>                  feature.style.externalGraphic = \&quot;images/markers/marker-gold.png\&quot;;<br></div>                  feature.style.pointRadius = 13;<br>                  feature.style.fillOpacity = 1;<br>

                  feature.layer.drawFeature(feature);<br>                 }<br>              }<br><br>Though that if statement there must be surely incorrect but I wasn&#39;t able to trigger the event of a point added any other way.<br>

<br>On to figuring out the different images now!<br><br>Thanks,<br><br>Alex<br></div><br><br><div class="gmail_quote">On Fri, Feb 5, 2010 at 3:34 PM, Alexandre Dube <span dir="ltr">&lt;<a href="mailto:adube@mapgears.com">adube@mapgears.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Alex,<br>
<br>
 Instead of defining the externalGraphic property directly in your StyleMap (that affects all your features on your layer), you could register a &quot;featureadded&quot; event to your DrawFeature control for points and set the externalGraphic property there.  You would need to redraw your feature to affect the new style.  This might look like (untested) :<br>

<br>
  var oDrawPoint = new OpenLayers.Control.DrawFeature(vectors, OpenLayers.Handler.Point);<br>
  oDrawPoint.events.on({&quot;featureadded&quot;: onPointFeatureAdded, scope: oDrawPoint});<br>
<br>
  var onPointFeatureAdded = function(event) {<br>
       var feature = event.feature;<br>
       var symbolizer = this.layer.styleMap.createSymbolizer(feature);<br>
       feature.style = symbolizer;<br>
       feature.style.externalGraphic = &quot;images/markers/marker-gold.png&quot;;<br>
       feature.style.pointRadius = 10;<br>
       this.layer.drawFeature(feature);<br>
   };<br>
<br>
   The remaining thing to do is to think about how to have different markers for your features.<br>
<br>
Hope this helps,<br>
<br>
Alexandre<br>
<br>
<br>
<br>
Alex G. wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Alexandre,<br>
<br><div><div></div><div class="h5">
thanks again for your valuable help!<br>
<br>
At the moment the best idea would be to have vector points as markers, which would make them both clickable and perfect for what I need to do.<br>
<br>
I have added this info to the vector layer:<br>
<br>
            vectors = new OpenLayers.Layer.Vector(&#39;Vectors&#39;, {<br>
                styleMap: new OpenLayers.StyleMap({<br>
                    externalGraphic: &quot;images/markers/marker-gold.png&quot;,<br>
                    pointRadius: 10<br>
                })<br>
            });<br>
<br>
And the point appears correctly with the marker icon. But I have run into 2 problems now:<br>
<br>
1) All my polygons and lines appear black or invisible<br>
2) I would like to use more than one image for the markers<br>
<br>
My controls looks like this:<br>
<br>
            controls = {<br>
                point: new OpenLayers.Control.DrawFeature(vectors,<br>
                            OpenLayers.Handler.Point),<br>
                line: new OpenLayers.Control.DrawFeature(vectors,<br>
                            OpenLayers.Handler.Path),<br>
                polygon: new OpenLayers.Control.DrawFeature(vectors,<br>
                            OpenLayers.Handler.Polygon),<br>
                drag: new OpenLayers.Control.DragFeature(vectors),<br>
                select: selectControl<br>
            };<br>
<br>
Is there a way to maybe pass the external image specifically to the &quot;point&quot; control?<br>
<br>
I am unsure about the syntax and I wasn&#39;t able to find any info around, maybe something like this:<br>
<br>
point: new OpenLayers.Control.DrawFeature(vectors,<br>
                            OpenLayers.Handler.Point, {style: blah blah}),<br>
<br>
If it&#39;s possible, then that solves my 2nd problem as well for different images.<br>
<br>
Thanks in advance!<br>
<br>
Best regards,<br>
<br>
Alex<br>
<br></div></div></blockquote><div><div></div><div class="h5">
<br>
<br>
-- <br>
Alexandre Dubé<br>
Mapgears<br>
<a href="http://www.mapgears.com" target="_blank">www.mapgears.com</a><br>
<br>
</div></div></blockquote></div><br>