<div style="margin-left: 40px;">hello All, i myself was recently working on the problem of adding a custom marker with custom text, and with the help of open-layers examples code i was able to achieve following:<br>1. Add a marker with a custom icon and label, each time i click  on the map. <br>
2. Able to drag markers<br><br>I have only this suggestion that this functionality is pretty basic and should be made part of editing toolbar, along with the option to save and load KML data. <br><br>Here is the complete working code: You can copy paste this code in an html file in the open-layers 2.9 examples folder and it should work fine :-)<br>
----------------------------------Code to add a custom marker---------------------<br>&lt;html xmlns=&quot;<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>&quot;&gt;<br>    &lt;head&gt;<br>        &lt;title&gt;OpenLayers Click Event Example&lt;/title&gt;<br>
        <br>        &lt;link rel=&quot;stylesheet&quot; href=&quot;../theme/default/style.css&quot; type=&quot;text/css&quot; /&gt;<br>        &lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; type=&quot;text/css&quot; /&gt;<br>
        &lt;script src=&quot;../lib/OpenLayers.js&quot;&gt;&lt;/script&gt;<br>        &lt;script type=&quot;text/javascript&quot;&gt;<br>   <br>        var SHADOW_Z_INDEX = 10;<br>        var MARKER_Z_INDEX = 11;<br>        var DIAMETER = 200;<br>
        var NUMBER_OF_FEATURES = 15;<br><br>            var map,layer;<br>            function init(){<br>                map = new OpenLayers.Map(&#39;map&#39;);<br>                var ol_wms = new OpenLayers.Layer.WMS( &quot;OpenLayers WMS&quot;,<br>
                    &quot;<a href="http://labs.metacarta.com/wms/vmap0">http://labs.metacarta.com/wms/vmap0</a>?&quot;, {layers: &#39;basic&#39;} );<br><br>                var jpl_wms = new OpenLayers.Layer.WMS( &quot;NASA Global Mosaic&quot;,<br>
                &quot;<a href="http://t1.hypercube.telascience.org/cgi-bin/landsat7">http://t1.hypercube.telascience.org/cgi-bin/landsat7</a>&quot;, <br>                {layers: &quot;landsat7&quot;});<br><br>                jpl_wms.setVisibility(false);<br>
                map.addLayers([ol_wms, jpl_wms]);<br>                map.addControl(new OpenLayers.Control.LayerSwitcher());<br>                // map.setCenter(new OpenLayers.LonLat(0, 0), 0);<br>                map.zoomToMaxExtent();<br>
 <br>            layer = new OpenLayers.Layer.Vector(<br>                &quot;Marker Drop Shadows&quot;,<br>                {<br>                        styleMap: new OpenLayers.StyleMap({<br>                  //label: &quot;${foo}&quot;, // label will be foo attribute value<br>
                     graphicYOffset: -25, // shift graphic up 28 pixels<br>                  label : &quot;${name}&quot;,<br>                        // Set the external graphic and background graphic images.<br>                        externalGraphic: &quot;${icon}&quot;,<br>
                        backgroundGraphic: &quot;./marker_shadow.png&quot;,<br>                        <br>                        // Makes sure the background graphic is placed correctly relative<br>                        // to the external graphic.<br>
                        backgroundXOffset: -2,<br>                        backgroundYOffset: -20,<br>                        <br>                        // Set the z-indexes of both graphics to make sure the background<br>
                        // graphics stay in the background (shadows on top of markers looks<br>                        // odd; let&#39;s not do that).<br>                        graphicZIndex: MARKER_Z_INDEX,<br>                        backgroundGraphicZIndex: SHADOW_Z_INDEX,<br>
                        pointRadius: 10<br>                    }),<br>                    isBaseLayer: false,<br>                    rendererOptions: {yOrdering: true}<br>                }<br>            );<br>            <br>
            map.addLayers([layer]);<br>            <br>            // Add a drag feature control to move features around.<br>            var dragFeature = new OpenLayers.Control.DragFeature(layer);<br>            <br>            map.addControl(dragFeature);<br>
            <br>            dragFeature.activate();<br>           <br>                var click = new OpenLayers.Control.Click();<br>                map.addControl(click);<br>                click.activate();<br><br>            }<br>
<br> OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {                <br>                defaultHandlerOptions: {<br>                    &#39;single&#39;: true,<br>                    &#39;double&#39;: false,<br>
                    &#39;pixelTolerance&#39;: 0,<br>                    &#39;stopSingle&#39;: false,<br>                    &#39;stopDouble&#39;: false<br>                },<br><br>                initialize: function(options) {<br>
                    this.handlerOptions = OpenLayers.Util.extend(<br>                        {}, this.defaultHandlerOptions<br>                    );<br>                    OpenLayers.Control.prototype.initialize.apply(<br>
                        this, arguments<br>                    ); <br>                    this.handler = new OpenLayers.Handler.Click(<br>                        this, {<br>                            &#39;click&#39;: this.trigger<br>
                        }, this.handlerOptions<br>                    );<br>                }, <br><br>                trigger: function(e) {<br>                    var lonlat = map.getLonLatFromViewPortPx(e.xy);<br>                    //alert(&quot;You clicked near &quot; + lonlat.lat + &quot; N, &quot; +lonlat.lon + &quot; E&quot;);<br>
                <br>                //layer.removeFeatures(layer.features);<br>                var features = [];<br>                    var myMarker = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(lonlat.lon , lonlat.lat)); <br>
                var MarkerLabel= document.getElementById(&quot;Marker Label&quot;).value;<br>                var MarkerIcon= document.getElementById(&quot;Icon&quot;).value;<br>                myMarker.attributes = {<br>                                        name: MarkerLabel,<br>
                                icon: &quot;../img/&quot; + MarkerIcon + &quot;.png&quot;<br>                                };<br>                features.push(myMarker);<br>                layer.addFeatures(features);<br>
                }<br><br>            });<br><br>        &lt;/script&gt;<br>    &lt;/head&gt;<br>    &lt;body onload=&quot;init()&quot;&gt;<br>        &lt;h1 id=&quot;title&quot;&gt;Click Event Example with Custom Marker&lt;/h1&gt;<br>
<br>        &lt;div id=&quot;tags&quot;&gt;<br>        &lt;/div&gt;<br><br>        &lt;p id=&quot;shortdesc&quot;&gt;<br>            This example shows the use of the click handler and getLonLatFromViewPortPx functions to trigger events on mouse click.It also shopws how to add a custom marker with custom Icon <br>
<br>        &lt;/p&gt;<br><br>        &lt;div id=&quot;map&quot; class=&quot;smallmap&quot;&gt;&lt;/div&gt;<br>    <br>        &lt;div id=&quot;docs&quot;&gt;<br>            &lt;label for=&quot;Marker Label&quot;&gt; -Label&lt;/label&gt;<br>
                &lt;input id=&quot;Marker Label&quot; type=&quot;text&quot; size=&quot;5&quot; maxlength=&quot;5&quot;<br>                       name=&quot;Marker Label&quot; value=&quot;label&quot; onchange=&quot;update()&quot; /&gt;<br>
<br>        &lt;label for=&quot;Icon&quot;&gt;Icon&lt;/label&gt;<br>            &lt;select name=&quot;Icon&quot; id=&quot;Icon&quot;&gt;<br>                &lt;option value=&quot;marker&quot; selected=&quot;selected&quot;&gt;marker-red&lt;/option&gt;<br>
                &lt;option value=&quot;marker-blue&quot;&gt;marker-blue&lt;/option&gt;<br>                &lt;option value=&quot;marker-gold&quot;&gt;marker-gold&lt;/option&gt;<br>                &lt;option value=&quot;marker-green&quot;&gt;marker-green&lt;/option&gt;<br>
            &lt;/select&gt;<br>        &lt;/div&gt;<br>    &lt;/body&gt;<br>&lt;/html&gt;<br><br>----------------------------------Code to add a custom 
marker---------------------<br></div>&gt;Hi everyone,<br><br>
&gt;I&#39;m working on an application that allows the user to add lines and 
vertices<br>
&gt;to the map, to construct routes. In Google Maps, this would simply be<br>
&gt;markers and polylines.<br><br>
&gt;Using the OpenLayers abstraction layer, should I be using 
OpenLayers.Marker?<br>
&gt;What about the line segments? If they&#39;re on a separate layer, will they<br>
&gt;still be able to receive clicks?<br><br>
&gt;I read elsewhere that the use of Marker and Layer.Markers is effectively<br>
&gt;deprecated in the OpenLayers world, in favour of Layer.Vector. Is this 
true?<br>
&gt;Is there one of the basic examples that demonstrates dynamically adding 
and<br>
&gt;removing different objects from a Layer.Vector? Ideally, something like:<br>
&gt;click the map to create a marker, click the marker to delete it.<br><br>
&gt;Please note that I do not wish to use the standard editing toolbar that<br>
&gt;comes with OpenLayers?my application is fairly specialized, so I will 
need<br>
&gt;to build up this functionality from scratch.<br><br>
&gt;Thanks!