Hi Jason,
The getScale() method was reworked since the last release. You can get
the new beta version of OpenMap with the fix at http://openmap.bbn.com
via cvs. The instructions for checking the code out of cvs are on the
download page.
- Don
On Monday, April 14, 2003, at 08:18 AM, McIlvain Jason B Contr
AFRL/IFSF wrote:
> Fellow Openmappers,
>
> I'm having some trouble with the getScale function.
>
> com.bbn.openmap.proj.ProjMath.getScale(llp1,llp2,map.getProjection());
>
> I double checked that llp1 is top left and llp2 is bottom right.
> However,
> the getScale function doesn't seem to be returning the correct scale.
> I'm
> passing it the extents of a an EsriGraphicList. I want to center and
> set
> the map scale so the shapes will just fit within the dimensions of the
> surronding map window. Below is the code.
>
> float[] fexts = layer.getEsriGraphicList().getExtents();
> centery = fexts[0] + (fexts[2]-fexts[0])/2;
> centerx = fexts[1] + (fexts[3]-fexts[1])/2;
> LatLonPoint llp1 = new LatLonPoint(fexts[2],fexts[1]);
> LatLonPoint llp2 = new LatLonPoint(fexts[0],fexts[3]);
> float newScale =
> com.bbn.openmap.proj.ProjMath.getScale(llp1,llp2,projection);
> map.setCenter(centery, centerx);
> map.setScale(newScale);
>
>
>
> It seems that some projections work better or different than others.
> I'm
> currently using CADRG. I've also noticed that typically the scale
> returnd
> from the function is too low. Any help is greatly appreciated,
>
> Thanks,
> Jason
>
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 Mon Apr 14 18:12:56 2003
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:35 EDT