Re: [OpenMap Users] bug ? in Location.distance()

From: OpenMap Support <openmap_at_bbn.com>
Date: Wed, 23 Feb 2005 10:57:04 -0500

Thanks for the report, Thomas, I've incorporated the fix into the next
version.

Sending reports to openmap-users is OK. It's all good.

- Don

On Feb 21, 2005, at 11:39 AM, Thomas Coffin wrote:

> Oops I intended to send this mail to openmap_at_bbn.com, it seems that
> Outlook's automatic completion did not agree with this.
>
> Sorry !
>
> Thomas
>
> ----- Original Message ----- From: "Thomas Coffin"
> <thomas.coffin_at_artelys.com>
> To: <openmap-users_at_bbn.com>
> Sent: Friday, February 18, 2005 3:24 PM
> Subject: [OpenMap Users] bug ? in Location.distance()
>
>
>> Hi,
>>
>> I noticed a bug - or at least a strange feature - in
>> Location.distance(),
>> openmap v4.6.1 :
>> public float distance(int x, int y) {
>> float labelDist = Float.MAX_VALUE;
>> float locationDist = Float.MAX_VALUE;
>> boolean globalShowLocations = false;
>> boolean globalShowNames = false;
>>
>> if (handler != null) {
>> globalShowLocations = handler.isShowLocations();
>> globalShowNames = handler.isShowNames();
>> }
>>
>> if (showLocation && location != null) {
>> locationDist = location.distance(x, y);
>> }
>>
>> if (showName && label != null) {
>> labelDist = label.distance(x, y);
>> }
>>
>> return (locationDist > labelDist ? labelDist : locationDist);
>> }
>>
>> the globalShowLocations and globalShowNames local variables are
>> initialized
>> but never accessed.
>> I believe the two last "if" conditions should rather be like the ones
>> in renderName and renderLocation (introducing a forceGlobal variable)
>> :
>>
>>
>> if (((forceGlobal && globalShowLocations) || (!forceGlobal &&
>> showLocation)) && location != null) {
>> locationDist = location.distance(x, y);
>> }
>>
>> if (((forceGlobal && globalShowNames) || (!forceGlobal && showName))
>> && label != null) {
>> labelDist = label.distance(x, y);
>> }
>>
>> Regards,
>>
>> Thomas
>>
>> --------------------------------------
>> Thomas Coffin
>> Artelys
>> http://www.artelys.com
>> Tel. : + (33|0)1.41.46.19.00
>>
>> --
>> [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"]
>>
>
>
> --
> [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"]
>
>


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 Wed Feb 23 2005 - 10:57:34 EST

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