if you insert the circle into a vector layer , you should be able to get the coordinates of its geometry through the thwo lines I wrote in my response earlier.<div><br></div><div>regards,</div><div>Imran<br><br><div class="gmail_quote">
On Tue, Feb 7, 2012 at 5:20 PM, Blake <span dir="ltr"><<a href="mailto:blakeloizides@gmail.com">blakeloizides@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">I have created a map with create circle now after you draw the circle I want the<br>
coordinates of the circle.<br>
<br>
Please help?<br>
<br>
<br>
<br>
<html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>"><br>
<head><br>
<style type="text/css"><br>
html, body, #map {<br>
margin: 0;<br>
width: 100%;<br>
height: 100%;<br>
}<br>
<br>
</style><br>
<br>
<style type="text/css"><br>
#controls {<br>
width: 512px;<br>
position: absolute;<br>
bottom: 1em;<br>
left: 1em;<br>
width: 300px;<br>
z-index: 20000;<br>
background-color: #8194D5;<br>
padding: 0 0.5em 0.5em 0.5em;<br>
}<br>
#controlToggle {<br>
padding-left: 1em;<br>
}<br>
#controlToggle li {<br>
list-style: none;<br>
}<br>
</style><br>
<br>
<link rel="stylesheet" href="theme/default/style.css" type="text/css"><br>
<link href="css/style.css" rel="stylesheet" type="text/css" /><br>
<script src="js/firebug.js"></script><br>
<script src="<a href="http://www.openlayers.org/dev/OpenLayers.js" target="_blank">http://www.openlayers.org/dev/OpenLayers.js</a>"></script><br>
<br>
<script type="text/javascript"><br>
var lon = 24.0000000000;<br>
var lat = -29.000000000000;<br>
<br>
var zoom = 4;<br>
var map, layer, vectors, controls;<br>
<br>
function init(){<br>
<br>
// Because the Streetmaps system uses 300x300 tiles, we need to set<br>
up the scaling variables to work with these<br>
<br>
<br>
var aRes =<br>
<br>
<br>
[90,45,22.500000,11.250000,<br>
5.625000,2.812500,1.406250,0.703125,<br>
0.351563,0.175781,0.087891,0.043945,0.021973,0.010986,<br>
0.005493,0.002747,0.001373,0.000687,0.000343];<br>
for (var l=0;l<aRes.length;l++) { aRes[l] = aRes[l]/300; }<br>
<br>
// Normal init, but we pass through the info about the zoom/scaling as<br>
options<br>
map = new OpenLayers.Map( 'map', { tileSize:<br>
<br>
new OpenLayers.Size(300,<br>
300), projection: 'CRS:84',<br>
<br>
numZoomLevels:aRes.length, resolutions:aRes,<br>
maxResolution:360/300 } );<br>
<br>
// At this point the control is used as per normal<br>
layer1 = new OpenLayers.Layer.WMS(<br>
'Streetmaps Streets',<br>
'<a href="http://www.streetmaps.co.za/WMS/?" target="_blank">http://www.streetmaps.co.za/WMS/?</a>',<br>
{<br>
key:<br>
<br>
<br>
'HZPGNWPNDYPREPTIKSIHWKYKQYYOQVYX',<br>
service: 'WMS',<br>
request: 'GetMap',<br>
version: '1.3.0',<br>
layers:<br>
'sm.maps.tiled',<br>
format: 'image/png'<br>
}<br>
);<br>
<br>
layer2 = new OpenLayers.Layer.WMS(<br>
'Streetmaps Imagery',<br>
'<a href="http://www.streetmaps.co.za/WMS/?" target="_blank">http://www.streetmaps.co.za/WMS/?</a>',<br>
{<br>
key:<br>
'HZPGNWPNDYPREPTIKSIHWKYKQYYOQVYX',<br>
service: 'WMS',<br>
request: 'GetMap',<br>
version: '1.3.0',<br>
layers: 'sm.imagery',<br>
format: 'image/png'<br>
}<br>
);<br>
<br>
<br>
// This loads the overlays<br>
<br>
map.addLayer(layer1);<br>
map.addLayer(layer2);<br>
<br>
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);<br>
map.addControl( new OpenLayers.Control.LayerSwitcher() );<br>
<br>
var vectors = new OpenLayers.Layer.Vector("vector", {isBaseLayer: true});<br>
<br>
<br>
map.addControl(new OpenLayers.Control.EditingToolbar(vectors));<br>
map.addControl(new OpenLayers.Control.MousePosition());<br>
<br>
<br>
<br>
<br>
<br>
var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",<br>
"<a href="http://vmap0.tiles.osgeo.org/wms/vmap0" target="_blank">http://vmap0.tiles.osgeo.org/wms/vmap0</a>?", {layers: 'basic'});<br>
<br>
<br>
<br>
var polygonLayer = new OpenLayers.Layer.Vector("Polygon Layer");<br>
<br>
map.addLayers([wmsLayer, polygonLayer]);<br>
<br>
polyOptions = {sides: 40};<br>
polygonControl = new OpenLayers.Control.DrawFeature(polygonLayer,<br>
OpenLayers.Handler.RegularPolygon,<br>
{handlerOptions: polyOptions});<br>
<br>
<br>
<br>
<br>
<br>
map.addControl(polygonControl);<br>
<br>
<br>
document.getElementById('noneToggle').checked = true;<br>
document.getElementById('irregularToggle').checked = false;<br>
}<br>
<br>
<br>
<br>
<br>
<br>
<br>
function toggleControl(element) {<br>
for(key in controls) {<br>
var control = controls[key];<br>
if(element.value == key && element.checked) {<br>
control.activate();<br>
} else {<br>
control.deactivate();<br>
}<br>
}<br>
}<br>
<br>
<br>
<br>
</script><br>
</head><br>
<body onLoad="init()"><br>
<div id="map" class="smallmap"></div><br>
<div id="controls"><br>
<ul id="controlToggle"><br>
<li><br>
<input type="radio" name="type"<br>
value="none" id="noneToggle"<br>
onclick="polygonControl.deactivate()"<br>
checked="checked" /><br>
<label for="noneToggle">navigate</label><br>
</li><br>
<li><br>
<input type="radio" name="type"<br>
value="polygon" id="polygonToggle"<br>
onclick="polygonControl.activate()" /><br>
<label for="polygonToggle">draw polygon</label><br>
</li><br>
</ul><br>
<br>
<br>
<br>
</div><br>
</body><br>
</html><br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>I.R<br>
</div>