hi,<div><br></div><div>since there isn't a buffer function integrated in openlayers i have to find other ways to simulate buffering a point and displaying it:</div><div><br></div><div><br></div><div><div> function pointBuffer(lat, lon, radius,color){</div>
<div> polygonLayer.removeFeatures(polygonLayer.features);</div><div> var style = {</div><div> fillColor: '#ff0000',</div><div> strokeWidth: 1,</div><div>
pointRadius: radius, // in pixels</div><div> </div><div> };</div><div><br></div><div><br></div><div><br></div><div> var point = new OpenLayers.Geometry.Point(lat, lon);</div>
<div> var feature = new OpenLayers.Feature.Vector(point,null, style);</div><div> </div><div> polygonLayer.addFeatures([feature]);</div><div> polygonLayer.setOpacity(0.5);</div>
<div><br></div><div><br></div><div> }</div><div><br></div><div><br></div><div>---------------------------------------------------------------------------------------------------------------</div><div><br></div>
<div>...</div><div><div> var lonlat1=new OpenLayers.LonLat(parseInt(radius),0);</div><div> var lonlat2=new OpenLayers.LonLat(parseInt(radius*2),0);</div><div>
var pixel1=map.getLayerPxFromLonLat(lonlat1);</div><div> var pixel2=map.getLayerPxFromLonLat(lonlat2);</div><div> </div><div>
</div><div> var dist= Math.abs(parseInt(pixel2.x)-parseInt(pixel1.x));</div><div> </div><div> </div>
<div> createCircle(x,y,dist);</div><div><br></div><div><br></div><div>--------------------------------------------------------------------------------------------------------------</div><div>
<br></div><div>It works fine, but now the problem:</div><div>When zooming in or out the point feature won't resize -that means it does not changes. the pixel size/radius is the same in every zoom level.</div><div><br>
</div><div>for solving this, i thought of creating a linearring and then a polygon, of which i know that will automatically resize with zooming.</div><div><br></div><div>i tried: </div><div>var linearRing = new OpenLayers.Geometry.LinearRing(point); //just one point</div>
<div>var polygonFeature = new OpenLayers.Feature.Vector(</div><div> new OpenLayers.Geometry.Polygon([linearRing]),null, style);</div><div><br></div><div>but seems not to work..</div><div><br></div><div><br></div><div><br>
</div><div>anybody can help?</div><div><br></div><div><br></div><div>regards</div><div>m.sirin</div></div></div>