[OpenMap Users] Issue with getScale Function

From: McIlvain Jason B Contr AFRL/IFSF <Jason.McIlvain@rl.af.mil>
Date: Mon Apr 14 2003 - 08:18:27 EDT

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

--
[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 08:26:07 2003

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:35 EDT