[OpenLayers-Dev] Re: 2.11 SketchStarted
Xavier Mamano (jorix)
xavier.mamano at gmail.com
Tue Mar 6 11:07:09 EST 2012
Hi,
For other reasons (http://trac.osgeo.org/openlayers/ticket/3319) I was
looking at the third parameter ("drawing") on "modify" callback.
And I thought ... "point" callback ("point" only occurs when drawing) could
receive a "drawing" parameter and for the first point would be false. So
this would be the first point.
What opinion about it?
Xavier Mamano
erilem wrote
>
> On Tue, Mar 6, 2012 at 2:15 PM, fell_runner <stewartb at .co> wrote:
>> Thanks for the reply, but I don't understand your answer.
>>
>> The vector layer has no features to start with.
>
> When you move the mouse over the map there should a vector point
> following.
>
>> The user activates the
>> drawfeature control and I'm using the 'sketchstarted' event to determine
>> the
>> co-ordinates of where the user has started drawing.
>
> You can try this (untested):
>
> new OpenLayers.Control.Draw(layer, OpenLayers.Handler.Path, {
> callbacks: {
> point: function(point, line) {
> if (line.components.length == 2) {
> // user has actually started to draw,
> // and "point" is the first draw point
> }
> }
> }
> });
>
>
> --
> Eric Lemoine
>
> Camptocamp France SAS
> Savoie Technolac, BP 352
> 73377 Le Bourget du Lac, Cedex
>
> Tel : 00 33 4 79 44 44 96
> Mail : eric.lemoine@
> http://www.camptocamp.com
> _______________________________________________
> Dev mailing list
> Dev at .osgeo
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/2-11-SketchStarted-tp4550864p4551673.html
Sent from the OpenLayers Dev mailing list archive at Nabble.com.
More information about the Dev
mailing list