[OpenLayers-Users] Drawing polygons

Christopher Schmidt crschmidt at metacarta.com
Wed Mar 14 19:42:32 EDT 2007


On Wed, Mar 14, 2007 at 11:29:31PM +0000, Mike Quentel wrote:
> That's a very cool Canvas drawing demo.  
> 
> Here is what I'm wanting to do: integrate RichDraw 
> 
> http://starkravingfinkle.org/projects/richdraw/richdraw_demo.htm

Can you explain why you want to integrate richdraw, rather than using
the existing vector editing tools? I have a feeling your'e going to be
duplicating a lot of effort over something like
http://dev.openlayers.org/sandbox/vector-2.4/examples/editingtoolbar.html,
which has different functionality that is more well suited towards
OpenLayers.

If your concern is just with colors, don't let that stop you. It's
possible to change the style of any vector which is drawn: see the code
of http://dev.openlayers.org/sandbox/vector-2.4/examples/openmnnd.html
for an example of how to change feature colors.

OpenLayers already creates VML and SVG, so I don't think you gain
anything there.

> Where would I turn on/off the OpenLayers mouse event
> capture?  I'd like to make it possible to allow the
> user to turn on drawing tools, and when this happens,
> I don't want the mouse events to be captured by
> OpenLayers, but when the drawing tools are off, I'd
> like OpenLayers to resume capturing mouse events.

OpenLayers/Events.js is the class where this is defined. I have a
feeling it's not going to be as trivial as you want it to be. You might
want to look into registering events in OpenLayers -- move, up, etc. --
rather than 'turning OpenLayers Events off'.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list