[OpenLayers-Users] Drawing polygons

Christopher Schmidt crschmidt at metacarta.com
Wed Feb 14 11:13:14 EST 2007


On Wed, Feb 14, 2007 at 10:00:20AM -0600, Jeff Dege wrote:
> We have a need to draw polygons on a map.  The idea is to allow the
> users to interactively edit the boundaries of a number of field worker's
> service areas.  Driver X is responsible for work in area A, driver Y for
> area B, etc.  We need the users to be able to edit the boundaries of
> these areas, represented as arbitrary polygons.
> 
> The points will be stored in our own database, we're not writing shape
> files.
> 
> The question is, how do we do this in OpenLayers?  I've been seeing
> references to the vector layer - is this the sort of problem it is
> intended for?  Some time back, I saw references to a canvas layer.  Has
> that fallen by the wayside?

The canvas layer was a proof of concept, that never really well
supported this behavior. (in fact, I don't think I ever supported
polygons with it.) The Vector branch, at
http://svn.openlayers.org/sandbox/vector/ , is exactly suited for this,
including storage to WFS backends, support for GML, etc. etc. etc. 

http://dev.openlayers.org/sandbox/vector/examples/EditingDemo.html is
probably a decent example of the functionality in the Vector sandbox.

Select the layer switcher, pick the radio button next to 'vector layer',
click 'draw linearRing', then draw on the map.

The timeline for inclusion of the vector sandbox into the core of
OpenLayers is on the scale of 1-2 months. 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list