<div>hey newbie....</div>
<div>&nbsp;</div>
<div>I was busy for last some days so wasn&#39;t able to&nbsp;see ur message......</div>
<div>&nbsp;</div>
<div>I didn&#39;t get time to see the &quot;line not staying on layer&quot; problem and I think we will have to consult someone else for getting help on this.</div>
<div>&nbsp;</div>
<div>Well for your curosity..... I have noticed that if you want to cancel the drawing on map (if you have mis-drawn some point) then you can do it by selecting another control&#39;s radio button. You cannot even cancel drawing by pressing escape key.....</div>

<div>&nbsp;</div>
<div>Frankly speaking&nbsp;I think OpenLayers is (somewhat) lacking that capability of providing feature drawing nicely, but well...... whatever it is providing right now, is not less though.</div>
<div><br>&nbsp;</div>
<div class="gmail_quote">On Tue, Jan 27, 2009 at 10:03 PM, newbie <span dir="ltr">&lt;<a href="mailto:shai_mus@hotmail.com">shai_mus@hotmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Dear Jatin,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Thank you for your help. I really appreciate it. I try to edit<br>your code and added this one below. But unfortunately the map didnt appear.<br>
I have managed to get the drawing and also once I click i can see the points<br>coordinate but have u managed to why the line not stay? So what I am also<br>curious incase I make a mistake in my drawing can I edit or erase it ? My<br>
next step I want to save this coordinate into my database how do you suggest<br>? Thanks.<br>var wmsLayer = new OpenLayers.Layer.WMS(<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;topp:penang_polyline - Tiled&quot;,<br>&quot;<a href="http://localhost:8080/geoserver/wms" target="_blank">http://localhost:8080/geoserver/wms</a>&quot;,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;layers: &#39;topp:penang_polyline&#39;,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;styles: &#39;&#39;,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;height: &#39;550&#39;,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;width: &#39;502&#39;,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;srs: &#39;EPSG:4326&#39;,<br><br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tilesOrigin : &quot;100.3178548,5.3952127999237645&quot;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{buffer: 0}<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;);<br>

<div>
<div></div>
<div class="Wj3C7c"><br>Jatin Ambasana wrote:<br>&gt;<br>&gt; Sorry I forgot to attach the file that I mentioned in my previous post....<br>&gt; I have named it as draw-feature2.html<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; Jatin Ambasana wrote:<br>
&gt;&gt;<br>&gt;&gt; hey newbie...<br>&gt;&gt;<br>&gt;&gt; For drawing vector features.....<br>&gt;&gt; you can refer to<br>&gt;&gt; <a href="http://openlayers.org/dev/examples/draw-feature.html" target="_blank">http://openlayers.org/dev/examples/draw-feature.html</a><br>
&gt;&gt; <a href="http://openlayers.org/dev/examples/drag-feature.html" target="_blank">http://openlayers.org/dev/examples/drag-feature.html</a><br>&gt;&gt;<br>&gt;&gt; To achieve the functionality you need you can follow any of 2 methods<br>
&gt;&gt; mentioned below:<br>&gt;&gt;<br>&gt;&gt; 1)Change the following code in draw-feature.html:<br>&gt;&gt;<br>&gt;&gt; // This lets you call a function when a feature is inserted on vector<br>&gt;&gt; layer<br>&gt;&gt; var lineLayer = new OpenLayers.Layer.Vector(&quot;Line<br>
&gt;&gt; Layer&quot;,{onFeatureInsert: featureIsAdded});<br>&gt;&gt;<br>&gt;&gt; //Add this funtion in your code<br>&gt;&gt; function featureIsAdded(feature){<br>&gt;&gt; &nbsp; &nbsp; &nbsp;alert(&quot;Feature with id: &quot;+<a href="http://feature.id/" target="_blank">feature.id</a>+&quot;, has following Geometry:<br>
&gt;&gt; &quot;+feature.geometry);<br>&gt;&gt; }<br>&gt;&gt;<br>&gt;&gt; I feel that would be sufficient for you......<br>&gt;&gt;<br>&gt;&gt; 2)There is also another nice example but some what different that you can<br>&gt;&gt; see from:<br>
&gt;&gt; &nbsp;<a href="http://openlayers.org/pipermail/users/2007-June/001998.html" target="_blank">http://openlayers.org/pipermail/users/2007-June/001998.html</a><br>&gt;&gt; <a href="http://openlayers.org/pipermail/users/2007-June/001998.html" target="_blank">http://openlayers.org/pipermail/users/2007-June/001998.html</a><br>
&gt;&gt;<br>&gt;&gt; I have modified that code and I am attaching that with this post.... But<br>&gt;&gt; it has few problems.... It does show you the co-oridnates of all points<br>&gt;&gt; of the line drawn but it does not add the line to the Line Layer...<br>
&gt;&gt;<br>&gt;&gt; I don&#39;t understand why it works in the previous standard OpenLayers<br>&gt;&gt; example and not in the second example that I downloaded from above<br>&gt;&gt; link......<br>&gt;&gt;<br>&gt;&gt; If someone has solution for that then that would nice of him/her.....<br>
&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; newbie wrote:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Dear All,<br>&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;I am using geoserver and managed to put a sample shapefile<br>&gt;&gt;&gt; and able to view my simple map well. The problem now is that on top that<br>
&gt;&gt;&gt; map I want to add a layer where I can like draw polygon and capture the<br>&gt;&gt;&gt; coordinates accordingly. How can I do this ? Thanks.<br>&gt;&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt; &nbsp;<a href="http://n2.nabble.com/file/n2222990/draw-feature2.html" target="_blank">http://n2.nabble.com/file/n2222990/draw-feature2.html</a> draw-feature2.html<br>
&gt;<br><br>--<br></div></div>View this message in context: <a href="http://n2.nabble.com/How-to-add-a-an-overlay-on-top-of-a-map--tp2196295p2226702.html" target="_blank">http://n2.nabble.com/How-to-add-a-an-overlay-on-top-of-a-map--tp2196295p2226702.html</a><br>

<div>
<div></div>
<div class="Wj3C7c">Sent from the OpenLayers Users mailing list archive at Nabble.com.<br><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><br></div></div></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Jatin Ambasana<br>iWork Technologies Pvt. Ltd.<br>
Mobile:+91-9765394718<br>Mail: &nbsp;<a href="mailto:jatin.a@iworktech.com">jatin.a@iworktech.com</a><br>Visit us: <a href="http://www.iworktech.com">www.iworktech.com</a> <br>