RE: [OpenMap Users] Setting resolution for lat,lon display

From: Chris Hopkins <chopkins_at_cra.com>
Date: Wed, 28 Nov 2007 11:15:57 -0500

Hi Chris -

 

Actually, if you had checked the source first you would have seen this
isn't currently possible with 4.6.3. :-)

 

Don, if this addition seems kosher to you, can you add the method below
to the CoordMouseMode.java for a future release? It will allow people to
customize the decimal places of the lat/lon. You can either set:

 

coordMouseMode.coordFormat=0.####

 

or customize it for each CoordMouseMode derived class such as the
NavMouseMode by doing:

 

navMouseMode.coordFormat=0.#####

 

The nice thing is that it follows the DecimalFormat format rules so
there is a lot of flexibility. It could be even more flexible if OpenMap
were to require Java 1.5 and you used the Formatter class and used
sprintf like syntax. :-)

 

  public void setProperties(String prefix, Properties props)

  {

    super.setProperties(prefix, props);

 

    String value = props.getProperty("coordMouseMode.coordFormat",
"0.###");

    String modeSpecificValue = props.getProperty(prefix +
"coordFormat");

    if (modeSpecificValue != null && modeSpecificValue.length() > 0)

    {

      value = modeSpecificValue;

    }

 

    df = new DecimalFormat(value);

  }

 

I patched my local 4.6.3 source and produced a new openmap.jar. Of
course, if there's an easier way, I'd be interested in knowing the
solution.

 

Thanks,

Chris

 


 
 
 
 
THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS ADDRESSED. IT MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If you are not the intended recipient, your use of this message for any purpose is strictly prohibited. If you have received this communication in error, please delete the message and notify the sender so that we may correct our records.
 
________________________________
 
 


From: owner-openmap-users_at_bbn.com [mailto:owner-openmap-users_at_bbn.com]
On Behalf Of Chris Hopkins
Sent: Wednesday, November 28, 2007 10:26 AM
To: openmap-users_at_bbn.com
Subject: [OpenMap Users] Setting resolution for lat,lon display

 

Hi all -

 

Is there a configurable way to change the resolution of the lat/lon
values displayed by the information delegator? We'd like to have more
decimal places than is currently displayed.

 

Thanks,

Chris

 

 

 

 

 

THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS
ADDRESSED. IT MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL
AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If you are not the
intended recipient, your use of this message for any purpose is strictly
prohibited. If you have received this communication in error, please
delete the message and notify the sender so that we may correct our
records.


--
[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 Wed Nov 28 2007 - 11:16:30 EST

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