Using openlayers and javascript I wish to create two vector layers and add a polygon to one of them and a circle with a centre point to the other
My polygon will be in WKT and my circle will be a point with a radius (Either as a distance or converted into approx DMS First)
I’ve seen this page http://openlayers.org/dev/examples/vector-formats.html but I need to it onload as the variables will be passed from an HTML form into a Perl script witch in tern writes the open layers
This is as far as I’ve got
Var box = new OpenLayers.Format.WKT().read("POLYGON((1.3 52.1,1.4 52.1,1.4 52,1.3 52,1.3 52.1))”);
This fails error message is vector.div undefined do i need to create the layer first then add the feature?
Also Can I get the style from GeoServer or do I need to set it here? Haven’t a clue how to create the other layer.
Could some one give me and example of how to do this? By the way my base layer / co-ordinate system is WGS84 and so are the given co-ordinates.
Thanx Holly
UPDATE STYLE CODE
If i wished to draw the new vector polygon as a green box with a black border would this work?
var Green_Box ={
fillColor: "#33CC00",
strokeColor: "#000000",
strokeWidth: 1
};
var vectorLayer = new OpenLayers.Layer.Vector("myPolygonLayer");
var format = new OpenLayers.Format.WKT({
'internalProjection': map.baseLayer.projection,
'externalProjection': new OpenLayers.Projection("EPSG:4326", {
'style': Green_box,
'renderers': renderer
});
note: was playing with this at work came home found the above but now unable to test it until after easter
Thanx

