On the sample code, you merely complete the polygon by clicking within
the first point you placed. Or you stop drawing a polyline by
clicking on the last point you just placed again, and it is completed.
Or you double-click to stop drawing either a line or shape.
If you are wanting to add new functionality to the code, then you'll
need to add some code to the click of the buttons. This code will need
to check to see if a draw operation was already in progress (you could
use a flag variable for this), and if so, it will need to execute the
code which completes the shape/line drawing.
Right now that code is in a function attached to the 'endline' event
of the polygon editing. You can see the function in the 'StartDrawing'
function, starting with this line:
GEvent.addListener(poly, "endline", function() {
// ... <function code cut to save space>
}
});
});
I'd separate that code out as an independent function which you can
attach to the listener AND call from the click button events.
Good luck!
-Mike Ethetton
http://mastertoolworks.com
http://mappingcenter.org
On Jul 27, 3:40 am, "[email protected]" <[email protected]> wrote:
> Hi I am using the codes
> in:http://gmaps-samples.googlecode.com/svn/trunk/poly/mymapstoolbar.html
>
> Initially I selected the "draw polygon" button and without doing
> anything on map I selected the "draw line" button option. Now when I
> started drawing on map it drew both polyline as well as polygon.
> Similarly for other permutations.
>
> Is there a way to kill/disable the instance of "draw polygon" before
> starting drawing the polygon. Similarly for polyline.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---