Re: [OpenMap Users] trying to understand EsriLayer

From: Don Dietrick <dietrick_at_bbn.com>
Date: Tue, 22 May 2007 13:41:42 -0400

Hi John,


On May 21, 2007, at 10:55 AM, John Chamberlain wrote:

>
> String sRender_Graphic( OMGraphic graphic ){
> if( graphic == null ){
> return ("null");
> } else if( graphic instanceof OMPoly ){
> OMPoly poly = (OMPoly)graphic;
> return (" " + poly.getLat() + " " +
> poly.getLon() + " " + sRender_RenderType( graphic.getRenderType() ) );
>

Here's your problem. poly.getLat() and poly.getLon() only apply to
OMPolys with RENDERTYPE_OFFSET, for their anchor point. Since you
are probably rendering RENDERTYPE_LATLON OMPolys, you need to call
poly.getLatLonArray(). Beware, though, getLatLonArray() returns a
lat/lon array of radian values, uncopied. If you convert them to
decimal degrees (using the MoreMath methods), you will mess up the
OMPoly. You'll want to copy them into a different array before
conversion and print that out instead.

Hope this helps,

Don


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick_at_bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Tue May 22 2007 - 13:42:09 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:08 EDT