FW: [OpenMap Users] Use of OMRect (UNCLASSIFIED)

From: Lackey, Michael B. (SED/BTI) <"Lackey,>
Date: Mon, 6 Aug 2007 08:42:46 -0500

Classification: UNCLASSIFIED
Caveats: NONE


You are 100% correct... there was something going on in *my* code.

I started with location layer as basis for our app, since it most
closeley fit our needs. However, was also had requirements to draw a
few rectangles on the map.

During prepare(), the layer calls the layerHandlers to obtain a list of
all graphics which should be rendered/painted. For rectangles, the
layerHandler was checking only one point of the rectangle (the n/w
point), and not all points of the rectangle (as it should). Which
resulted in this incorrect behavior: if north lat or east lon are
visible, place rectangle on graphics list, else disregard it. The result
was that rectangle would not be drawn, even when south lat or east lon
should have been visible.

I modified the code in our LocationLayer "get()" function to check for
special cases of rectangles, and for rectangles to check all 4 corners.
Problem was resolved.

Chalk it up to "headspace error" on my part.

Mike Lackey
Brockwell Technologies, Inc.

-----Original Message-----
From: Don Dietrick [mailto:dietrick_at_bbn.com]
Sent: Friday, August 03, 2007 3:12 PM
To: Lackey, Michael B. (SED/BTI)
Cc: openmap-users_at_bbn.com
Subject: Re: [OpenMap Users] Use of OMRect (UNCLASSIFIED)

Hi Mike,

On Jul 24, 2007, at 9:29 AM, Lackey, Michael B. ((SED/BTI)) wrote:

> Classification: UNCLASSIFIED
> Caveats: NONE
> Hello all,
> I have a question for the group.
> I am using an extended Layer to create some custom graphics. At the
> moment, very simple things like OMRect and OMScalingIcon.
> There is a behavior with OMRect that I would like to work around.
> Once placed, my layer's mouse listener will drag the rectangle around
> the screen. It moves the entire rectangle by moving each of the 4
> corners to current location plus some delta. As long as all 4 sides
> of the rectangles remain inside the BsaicMapPanel, it works fine.
> But if I move the rectangle, such that either the left side or the top

> side are moved outside the BasicMapPanel, not only does the one side
> disappear, all fours sides disappear, and the entire OMRect
> disappears.
> Example, if grab the bottom of the rectangle, and push it upwards,
> such that the top line segment moves off the map panel, all 4 sides
> disappear.
> This does not happen when the right/bottom sides are moved off the map

> panel, it only happens when the top and/or left sides are moved off
> panel.
> It "would be nice" if there were a way to draw the remaining 3 sides
> that could be visible. Searched the list arvhice, but didn't find
> anything there.

I think there is something going on in your code, OMGraphics will render
themselves partially on a map. OMGraphics depend on Java to do the
clipping, and the projection libraries don't really care about the pixel
extents of the Map.

> The RENDER-TYPE is LAT-LON. I wonder if it's related to x/y coords
> becoming negative?

The projection class would handle negative pixel coordinates and
translate them into lat/lon space.

> I've thought about changing the class to draw four lines instead of an

> OMRect, but that would mean rewriting a blob of (tested and working)
> code, but more importantly I'm not sure that would work either. So I
> thought I'd ask before I start hacking and slashing.

If you want to send me your layer code, I'll take a look at it to see if
something jumps out at me.

- Don

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

Classification: UNCLASSIFIED
Caveats: NONE

[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe
Classification:  UNCLASSIFIED 
Caveats: NONE
[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 Mon Aug 06 2007 - 09:44:14 EDT

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