<HTML dir=ltr><HEAD><TITLE>Re: [OpenLayers-Users] Circles</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6001.18148" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText43258 dir=ltr>
<DIV dir=ltr><FONT color=#000000></FONT><FONT face=Arial size=2>this is definitly a clever aproach, but it is still a work-around for what i consider to be a basic shape.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>I just wonder why i cant have something along the lines of: new Openlayers.Geometry.Circle(lon,lat,radius);</FONT><BR></DIV>
<DIV dir=ltr>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr><FONT face=Tahoma size=2><B>From:</B> Estanislao Gonzalez [mailto:estanislao.gonzalez@isst.fraunhofer.de]<BR><B>Sent:</B> Mon 12/8/2008 11:47 AM<BR><B>To:</B> Heidt, Christopher M.<BR><B>Subject:</B> Re: [OpenLayers-Users] Circles<BR></FONT><BR></DIV></DIV>
<DIV>
<P><FONT size=2>That's not true. You can always recalculate the circle radius when<BR>changing the zoom. That's what I did and had no problem at all.<BR><BR>//radius unit is in kilometers<BR>var DOTS_PER_UNIT = OpenLayers.INCHES_PER_UNIT.km *<BR>OpenLayers.DOTS_PER_INCH;<BR><BR>// 5 km radius<BR>var circleRadius = 5;<BR><BR>"default": new OpenLayers.Style({<BR> pointRadius: "${radius}"<BR> }, {<BR> context: {<BR> radius: function(feature){<BR> //very rough. Be sure it is at least somehow correct.<BR> var rad = circleRadius * DOTS_PER_UNIT /<BR>feature.layer.map.getScale();<BR> return rad;<BR> }<BR> }<BR> <BR> });<BR><BR>Still I didn't check if the measurement is right, but it is constant. So<BR>you might have to multiply it by a constant if required (probably by<BR>adapting DOTS_PER_UNIT).<BR><BR>Note that I'm reading the radius from a feature in a WFS layer, so you<BR>might have to change that as well (feature.attributes.radius)<BR><BR>Hope it helps,<BR><BR>Regards,<BR>Estani<BR><BR>Heidt, Christopher M. schrieb:<BR>> right, changing a points radius in the style makes the marker that represents a point larger, but it isnt a "Circle" Feature because it remains the same size when u zoom in and out.<BR>><BR>> oracle has a WKT outputer that makes a CURVEPOLYGON(# #,# #,# #,# #) or some such nonsence to represent circles. the problem is that it isnt part of the WKT spec so nothing supports it.<BR>><BR>> I'd change it to a format that is supported,<BR>> but i can't find anything in any format that can represent a circle.<BR>> Anybody know if it would be a daunting task to add CURVEPOLYGON support to the WKT parser?<BR>><BR>> ________________________________<BR>> From: users-bounces@openlayers.org on behalf of Lehtonen, Mika<BR>> Sent: Tue 12/2/2008 2:23 PM<BR>> To: Didrik Pinte<BR>> Cc: users@openlayers.org<BR>> Subject: Re: [OpenLayers-Users] Circles<BR>><BR>><BR>> Hi Didrik,<BR>><BR>> I guess the points are still points regardless of their style? So you<BR>> can't use their geometry as a replacement of a circle?<BR>><BR>> - mika -<BR>><BR>> Didrik Pinte kirjoitti:<BR>> <BR>>> On Tue, 2008-12-02 at 08:27 -0500, Heidt, Christopher M. wrote:<BR>>><BR>>> <BR>>>> Probably a dumb question, but how can I create a circle feature using<BR>>>> the api?<BR>>>><BR>>>> I'm hoping you're not going to say I have to generate a bunch of<BR>>>> points an make a polygon :(<BR>>>><BR>>>> <BR>>> Using a point with a style using a radius will do it fine.<BR>>><BR>>> For example :<BR>>> <A href="http://openlayers.org/dev/examples/stylemap.html">http://openlayers.org/dev/examples/stylemap.html</A><BR>>><BR>>> Didrik<BR>>><BR>>> ------------------------------------------------------------------------<BR>>><BR>>> _______________________________________________<BR>>> Users mailing list<BR>>> Users@openlayers.org<BR>>> <A href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</A><BR>>><BR>>> <BR>> _______________________________________________<BR>> Users mailing list<BR>> Users@openlayers.org<BR>> <A href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</A><BR>><BR>> <BR><BR><BR>--<BR>Dipl.-Kfm. Estanislao Gonzalez, Fraunhofer-Institut für Software- und Systemtechnik ISST<BR>Location-based Services, Steinplatz 2, 10623 Berlin, Germany<BR>Telefon: +49 (0) 30 / 2 43 06-3 36<BR><A href="mailto:estanislao.gonzalez@isst.fraunhofer.de">mailto:estanislao.gonzalez@isst.fraunhofer.de</A><BR>www.isst.fraunhofer.de<BR><BR></FONT></P></DIV></BODY></HTML>