You just simply set the 'layer' property.
draw.layer = new_layer
Now the draw tool works against the new layer.
Matt Priour
Kestrel Computer Consulting
--------------------------------------------------
From: <[email protected]>
Sent: Monday, November 01, 2010 11:00 AM
To: <[email protected]>
Subject: Dev Digest, Vol 50, Issue 1
Send Dev mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.osgeo.org/mailman/listinfo/openlayers-dev
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Dev digest..."
Today's Topics:
1. setLayer (Mohammed Rashad)
----------------------------------------------------------------------
Message: 1
Date: Mon, 1 Nov 2010 14:54:47 +0530
From: Mohammed Rashad <[email protected]>
Subject: [OpenLayers-Dev] setLayer
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
draw = new OpenLayers.Control.DrawFeature( wfs,
OpenLayers.Handler.Polygon,{
title: "Draw Feature", "displayClass: "olControlDrawFeaturePolygon",multi:
true } );
wfs is my current layer.
I had a function addLayer which add a new layer called new_layer.
How to change the layer of control "draw". I looked at OL documentation
and
cannot find any function to set layers.
Can we change the layer which control points to by any method.?
Any help will be greatly appreciated.
Thanks in advance
--
Rashad
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20101101/28d95539/attachment-0001.html
------------------------------
_______________________________________________
Dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-dev
End of Dev Digest, Vol 50, Issue 1
**********************************
_______________________________________________
Dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-dev