Hello,
You should use an OMRect object for rectangles, and you need to add the
distance to the second centerY coordinate (instead of subtracting it).
I'm not sure your algorithm will work, at least for all projections (it
seems like it should, but I have a nagging suspicion it doesn't). I'd
use the com.bbn.openmap.proj.GreatCircle.spherical_between() method to
calculate your corner points of the rectangle.
Hope this helps,
Don
On Thursday, May 16, 2002, at 10:32 PM, someyo_project wrote:
> hi,everyone<BR>> I want to generate a
> rectangle that own 2000 meter width and 1000 meter
> height.<BR>> I used the function
> Length.METER.toRadians,but finnally I got a rectangle whose width is 15
> meters and height is 35 meters.<BR>>
> y???<BR>> any reply will be
> appreciated.<BR>> fllow my code:<BR>>
> /********************************************************************************<BR>
> > public OMGraphicList createGraphics
> (OMGraphicList graphics)
> {<BR>> OMLine
> line;<BR>> <BR>>
> graphics.clear();<BR>>
> <BR>> /<A
> href="file://create">/create</A> a rectange that own width 2000 M and
> height 1000M<BR>> <A
> href="file://and!
> !
> !
> !
> !
> ">//and</A> center at beijing
> site<BR>> float
> centerX =
> 39.5622f;<BR>> float
> centerY =
> 116.2422f;<BR>> <A
> href="file://bottom">//bottom</A>
> line<BR>> line =
> createLine(centerX -
> Length.METER.toRadians(1000f),<BR>>
>
> centerY -
> Length.METER.toRadians(500f),<BR>>
>
> centerX +
> Length.METER.toRadians(1000f),<BR>>
>
> center!
> !
> !
> !
> !
> Y -
> Length.METER.toRadians(500f),<BR>>
>
>
> OMGraphic.LINETYPE_STRAIGHT,<BR>>
> Color.red,
> Color.yellow);<BR>>
> line.setAppObject(new
> Integer(10));<BR>>
> graphics.addOMGraphic(line);<BR>>
> //right
> line<BR>> line =
> null;<BR>> line =
> createLine(centerX +
> Length.METER.toRadians(1000f),<BR>>
>
> centerY -
> Length.METER.toRadians(500f),<BR>> &n!
> !
> !
> !
> !
> bsp;
> centerX +
> Length.METER.toRadians(1000f),<BR>>
>
> centerY +
> Length.METER.toRadians(500f),<BR>>
>
>
> OMGraphic.LINETYPE_STRAIGHT,<BR>>
>
> Color.green,
> Color.yellow);<BR>>
> line.setAppObject(new
> Integer(20));<BR>>
> graphics.addOMGraphic(line);<BR>>
> <A !
> !
> !
> !
> !
> href="file://top">//top</A>
> line<BR>> line =
> null;<BR>> line =
> createLine(centerX -
> Length.METER.toRadians(1000f),<BR>>
>
> centerY +
> Length.METER.toRadians(500f),<BR>>
>
> centerX +
> Length.METER.toRadians(1000f),<BR>>
>
> centerY +
> Length.METER.toRadians(500f),<BR>>
>
> &nbs!
> !
> !
> !
> !
> p;
> OMGraphic.LINETYPE_STRAIGHT,<BR>>
>
> Color.blue,
> Color.yellow);<BR>>
> line.setAppObject(new
> Integer(30));<BR>>
> graphics.addOMGraphic(line);<BR>>
> //left
> line<BR>> line =
> null;<BR>> line =
> createLine(centerX -
> Length.METER.toRadians(1000f),<BR>>
>
> centerY -
> Length.METER.toRadians(500f),<BR>>
> !
> !
> !
> !
> !
> centerX -
> Length.METER.toRadians(1000f),<BR>>
>
> centerY +
> Length.METER.toRadians(500f),<BR>>
>
>
> OMGraphic.LINETYPE_STRAIGHT,<BR>>
>
> Color.blue,
> Color.yellow);<BR>>
> line.setAppObject(new
> Integer(40));<BR>>
> graphics.addOMGraphic(line);<BR>>
> return graphics;<BR>>
> }<BR>> *********!
> !
> !
> !
> !
> ***********************************************************************/<BR>
> > <BR>> thanx u in advance!<BR>> <BR>
> Content-type: text/html; charset=gb2312
> Content-Transfer-Encoding: 8bit
>
> _______________________________________________
>
> <!-- saved from url=(0022)http://internet.e-mail -->
> <SCRIPT>
> bust = Math.floor(1000000*Math.random());
> document.write('<IFRAME WIDTH=468 HEIGHT=60 MARGINWIDTH=0
> MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no
> BORDERCOLOR="#000000"
> SRC="http://ads.elong.com/html.ng/dir=/main/add&sd=top&bust='+bust+'">\n'
> );
> document.write('<SCR' + 'IPT LANGUAGE="JavaScript1.1"
> SRC="http://ads.elong.com/js.ng/Params.richmedia=yes&dir=/main/add&sd=top&
> bust='+bust+'">\n');
> document.write('</SCR' + 'IPT>\n');
> document.write('</IFRAME>');
> </SCRIPT>
> <br>
> <p><a href=http://travel.elong.com/trip/play/fifa2002/
> target=_blank>ø’«∞»¸ ¬£¨“Ïπ˙÷Ƭ√</a></p><p><a
> href=http://ads.elong.com/event.ng/Type=click&ProfileID=443&RunID=3588&AdID=
> 1363&TagValues=317.431.515.550&FamilyID=1&GroupID=1&Redirect=http:%2F%2Fwww.
> gotocanada.com.cn%2Findex.asp%3Felong
> target=_blank>º”ƒ√¥ÛC&CŒ™ƒ˙÷∏µ„√‘ΩÚ</a></p><p><a
> href=http://ads.elong.com/event.ng/Type=click&ProfileID=157&RunID=3496&AdID=
> 1341&TagValues=505&FamilyID=1&GroupID=1&Redirect=http:%2F%2Fhttp://www.HeinekenChina.
> com%2FWorldParty target=_blank>øÏ¿¥»´«ÈÕ∂»Î</a></p><p><a
> href=http://travel.elong.com/member/mem_recommand.asp
> target=_blank>e¡˙ø®”–Ω±Õ∆ºˆ</a></p><p><a
> href=http://eticketing.elong.com/
> target=_blank>æ´≤ ∆±ŒÒ‘⁄œfl</a></p><p><a
> href=http://travel.elong.com/trip/photography
> target=_blank>ø¬¥Ô…„”∞¿÷‘∞</a></p>
> <br>
>
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, BBN Technologies, dietrick@bbn.com
10 Moulton Street, Cambridge, MA 02138
617-873-3031 [fax]-2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Tue May 21 08:34:12 2002
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:33 EDT