Hi All,
Can I draw a circle on open layer? If so,how can i make it? Any examples are appreciated
thx,
Baron
Hi All,
Can I draw a circle on open layer? If so,how can i make it? Any examples are appreciated
thx,
Baron
Use OpenLayers.Geometry.Polygon.createRegularPolygon function with sides parameter >= 20.
Or using a Point with a radius and style.
See OL examples: http://openlayers.org/dev/examples/draw-feature.html
Hi Pawel,thx for the help,now i use below code to draw circle,not sure i can set any attribute to make it draw ellipse?
new OpenLayers.StyleMap({
"default": new OpenLayers.Style({
pointRadius: "${type}", // sized according to type attribute,from getCircleFeature
//fillColor: "#ffcc66",
//graphicXOffset: 10,
strokeColor: "#ff9933",
strokeWidth: 2,
graphicZIndex: 1,
fillOpacity:0
//graphicName:circle,start,cross,triangle
}),
"select": new OpenLayers.Style({
fillColor: "#66ccff",
strokeColor: "#3399ff",
graphicZIndex: 2
})
})
Hi Lambertus thx for the help,can I set some attributes in below code to dreaw ellipse?
new OpenLayers.StyleMap({
"default": new OpenLayers.Style({
pointRadius: "${type}", // sized according to type attribute,from getCircleFeature
//fillColor: "#ffcc66",
//graphicXOffset: 10,
strokeColor: "#ff9933",
strokeWidth: 2,
graphicZIndex: 1,
fillOpacity:0
//graphicName:circle,start,cross,triangle
}),
"select": new OpenLayers.Style({
fillColor: "#66ccff",
strokeColor: "#3399ff",
graphicZIndex: 2
})
})