<div>hey newbie....</div>
<div> </div>
<div>I was busy for last some days so wasn't able to see ur message......</div>
<div> </div>
<div>I didn't get time to see the "line not staying on layer" problem and I think we will have to consult someone else for getting help on this.</div>
<div> </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's radio button. You cannot even cancel drawing by pressing escape key.....</div>
<div> </div>
<div>Frankly speaking 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> </div>
<div class="gmail_quote">On Tue, Jan 27, 2009 at 10:03 PM, newbie <span dir="ltr"><<a href="mailto:shai_mus@hotmail.com">shai_mus@hotmail.com</a>></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> 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> "topp:penang_polyline - Tiled",<br>"<a href="http://localhost:8080/geoserver/wms" target="_blank">http://localhost:8080/geoserver/wms</a>",<br>
{<br> layers: 'topp:penang_polyline',<br> styles: '',<br> height: '550',<br> width: '502',<br>
srs: 'EPSG:4326',<br><br><br> tilesOrigin : "100.3178548,5.3952127999237645"<br> },<br> {buffer: 0}<br> );<br>
<div>
<div></div>
<div class="Wj3C7c"><br>Jatin Ambasana wrote:<br>><br>> Sorry I forgot to attach the file that I mentioned in my previous post....<br>> I have named it as draw-feature2.html<br>><br>><br>><br>><br>> Jatin Ambasana wrote:<br>
>><br>>> hey newbie...<br>>><br>>> For drawing vector features.....<br>>> you can refer to<br>>> <a href="http://openlayers.org/dev/examples/draw-feature.html" target="_blank">http://openlayers.org/dev/examples/draw-feature.html</a><br>
>> <a href="http://openlayers.org/dev/examples/drag-feature.html" target="_blank">http://openlayers.org/dev/examples/drag-feature.html</a><br>>><br>>> To achieve the functionality you need you can follow any of 2 methods<br>
>> mentioned below:<br>>><br>>> 1)Change the following code in draw-feature.html:<br>>><br>>> // This lets you call a function when a feature is inserted on vector<br>>> layer<br>>> var lineLayer = new OpenLayers.Layer.Vector("Line<br>
>> Layer",{onFeatureInsert: featureIsAdded});<br>>><br>>> //Add this funtion in your code<br>>> function featureIsAdded(feature){<br>>> alert("Feature with id: "+<a href="http://feature.id/" target="_blank">feature.id</a>+", has following Geometry:<br>
>> "+feature.geometry);<br>>> }<br>>><br>>> I feel that would be sufficient for you......<br>>><br>>> 2)There is also another nice example but some what different that you can<br>>> see from:<br>
>> <a href="http://openlayers.org/pipermail/users/2007-June/001998.html" target="_blank">http://openlayers.org/pipermail/users/2007-June/001998.html</a><br>>> <a href="http://openlayers.org/pipermail/users/2007-June/001998.html" target="_blank">http://openlayers.org/pipermail/users/2007-June/001998.html</a><br>
>><br>>> I have modified that code and I am attaching that with this post.... But<br>>> it has few problems.... It does show you the co-oridnates of all points<br>>> of the line drawn but it does not add the line to the Line Layer...<br>
>><br>>> I don't understand why it works in the previous standard OpenLayers<br>>> example and not in the second example that I downloaded from above<br>>> link......<br>>><br>>> If someone has solution for that then that would nice of him/her.....<br>
>><br>>><br>>> newbie wrote:<br>>>><br>>>> Dear All,<br>>>> I am using geoserver and managed to put a sample shapefile<br>>>> and able to view my simple map well. The problem now is that on top that<br>
>>> map I want to add a layer where I can like draw polygon and capture the<br>>>> coordinates accordingly. How can I do this ? Thanks.<br>>>><br>>><br>>><br>> <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>
><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: <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>