Always looking for different drawing implementations I took a look. Notice that as you draw a line in Sanoodi you don't get a line from the last drawn vertice to your mouse pointer as it moves around (default OL control). Also each of your vertices have a circle. So a Sanoodi 'line' actually looks like a combination of a line feature with point features and as you click an additional point it adds a new vertice to the line and redraws it on the screen. It might even just be drawing multiple line segments. Probably just using the map onclick event to trigger this. In fact if you double click just slow enough (two fast single clicks effectively) you can get it to create a point without adding the next line segment.<br>
<br>-Tim<br><br><div class="gmail_quote">On Fri, Feb 26, 2010 at 6:19 PM, Richard Greenwood <span dir="ltr"><<a href="mailto:richard.greenwood@gmail.com">richard.greenwood@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Steve,<br>
<br>
This is not exactly what you are looking for, but you could watch<br>
sketchmodified and when the mouse was within a few pixels of any edge<br>
of the current map, you would pan the map a few pixels in that<br>
direction. This would mimic the behavior of MapInfo's "edge panning"<br>
(and probably other software) and it would provide the opportunity for<br>
the user to pan beyond the current map extents to place a new vertex.<br>
And you don't have to detect a 'click' or 'vertex added' event, which<br>
apparently doesn't exist.<br>
<br>
Regards,<br>
Rich<br>
<div><div></div><div class="h5"><br>
On Fri, Feb 19, 2010 at 4:58 AM, smartini <<a href="mailto:nabble@stevemartin.org.uk">nabble@stevemartin.org.uk</a>> wrote:<br>
><br>
><br>
> Christopher Schmidt-2 wrote:<br>
>><br>
>> On Tue, Feb 16, 2010 at 08:56:24AM -0800, smartini wrote:<br>
>>><br>
>>> Christopher,<br>
>>> sketchmodified appears to fire constantly while you are drawing and the<br>
>>> mouse is moving. I hooked this in to setCenter() for a laugh as the map<br>
>>> constantly recentered as I moved the mouse. This event appears to offer a<br>
>>> little more than I require.<br>
>>><br>
>>> I console logged all the events just to see if there was anything<br>
>>> suitable<br>
>>> but alas, there was not, hence my cry for help.<br>
>><br>
>> Makes sense. A quick look at the code doesn't show anything obvious that<br>
>> would be better.<br>
>><br>
>> -- Chris<br>
>><br>
><br>
> So, would you or anybody else in the community have any suggestions as to<br>
> how to go about handling such an event?<br>
> I offer as an example a site which manages to accomplish this:<br>
> <a href="http://www.sanoodi.com/routes/create/" target="_blank">http://www.sanoodi.com/routes/create/</a> (after registering/logging in)<br>
> though I have as yet been unable to reverse engineer the approach used here.<br>
><br>
> Regards,<br>
> Steve<br>
><br>
> --<br>
> View this message in context: <a href="http://n2.nabble.com/How-to-recenter-the-map-when-drawing-tp4581070p4597434.html" target="_blank">http://n2.nabble.com/How-to-recenter-the-map-when-drawing-tp4581070p4597434.html</a><br>
> Sent from the OpenLayers Users mailing list archive at Nabble.com.<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>
><br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
Richard Greenwood<br>
<a href="mailto:richard.greenwood@gmail.com">richard.greenwood@gmail.com</a><br>
<a href="http://www.greenwoodmap.com" target="_blank">www.greenwoodmap.com</a><br>
</font><div><div></div><div class="h5">_______________________________________________<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>