Re: [OpenMap Users] Re: Issues with Drawing Layers

From: Shawn McNaughton <shawngmc_at_gmail.com>
Date: Sun, 15 Jun 2008 15:19:54 -0400

I'll answer a few of the more generic questions about our setup before I
delve into the issue-specific ones. I don't have code snippets in front of
me (I'm at home, and the code can't easily leave the secure area at work due
to the sensitive nature of our customer and their work).

We have OpenMap in our program in two places. Our app is a set of 'viewers'
for various sets of data that may have geospatial coordinates. These
viewers are JInternalFrames with a few modifications - the biggest is that
components added to them go to a JPanel in the middle, allowing us to have
default menus and status bars to build off of. It also allows us to add the
ability to tear this out into a JFrame. We use the Substance Look and Feel
to offer the user a great deal of customization as well. We've put a ton of
work in this GUI, and I wish I could show it off, because I'm proud of it.
:)
As far as we know, the only problem this entire setup has is with
heavyweight components bleeding through. In fact, this was one of the
reasons we chose OpenMap - not only is it powerful, but as a lightweight
component it should be fine with this. Substance occasionally will also
interfere with components drawing, but it seems to be limited as well.

I'm hooking OpenMap together manually. I'm not using the OpenMap menubar,
nor am I using the ToolPanel - I have some custom controls we started
building for another map that I'm using, as they fit with the visual style
we use for our app a bit more. They're transparent, and are in a
JLayeredPane on the DRAG_LAYER, with our MapBean being on the DEFAULT_LAYER.

For layers, after we create the bean we create and add a MapHandler,
LayerManager, and then individual layers. The layers are set up in code
using properties objects that are currently hard-coded in - I plan to
eventually make a properties file for them, but just haven't gotten to it
yet. We currently have

   - 1 WMS Layer;
   - 2-3 EarthImagePlugIn PlugiInLayers;
   - 4 VPFLayers (4, to use all of the split NIMA VMAP data available from
   NGA Raster Roam - passing in all four paths to one did not seem to work...);
   - 1 Graticule Layer;
   - 2 ScaleFilterLayers, using the vmap_edge and vmap_area shapefiles you
   have - we shift between thin and full at about a scale of 40000000, but I
   need to work that out, seeing that scale's 'scale' changes when the
   MapBean/Projection's size/aspect ratio does;
   - 2 Custom PlugInLayers that use PlugIns we produced to hook up to our
   dataset and render points. (The first can hold many different data types,
   the second is for a certain type of reference data that we wanted to work a
   bit differently.)

The second instance of openmap only has the vmap_edge_thin and
vmap_area_thin layers, as well as a custom layer to select an area. It
cannot be resized (it's in a fixed JFrame), has the JLayeredPane to have our
custom controls, still uses Substance (as that affects the entire app), and
still exhibits every issue except the resize one for obvious reasons.

All of these issues existed before the switch from ToolPanel to our custom
controls, before the JLayeredPane, and without the VMAP and WMS layers
added.

I've yet to try reproducing these in a
JDesktopPane/JInternalFrame/JLayeredPane with and without Substance, and
that's my next step. After that, I'll be turning off the custom layers,
hoping that they aren't the cause, and working my way down from there.

On to more specific issues...
On Fri, Jun 13, 2008 at 7:06 PM, Don Dietrick <dietrick_at_bbn.com> wrote:

> Hi Shawn,
>
> Shawn McNaughton wrote:
>
>> I've been looking into my issues a bit further, and my implmentation is
>> down to three main issues. I was able to work around one of the previous
>> issues, however.
>> The first one ("Whenever I zoom out too far, I get a blank map display, or
>> one that only has the very edges drawn on."), I'm forcefully limiting the
>> scale of the map. I can't use the Proj class Max scale, because on MapBean
>> resize it recalculates. It seems to be giving a value that is just too
>> large, but I'm not sure. My 'hack' is to add a projection listener, and
>> whenever the size of the MapBean changes, take the 'maxscale' it calculates
>> and multiply it by .96. Not perfect, so I'm open to suggestions.
>>
>
> I've not seen this. Does it happen for all projection types?
>
> The max scale basically limits the scale of the map so no more than 360
> degrees are shown on the map at a time. But, if you hit the limit during a
> projection change, the scale should be set to the max scale and the layers
> should respond accordingly. I can't think of a reason why the layers
> wouldn't render, however, if the max scale were to be circumvented the
> layers would still render.


As of right now, we're only allowing use of the LLXY projection. If I
remember correctly, this is due to a note I saw about the WMS layer. Should
any of the layers I've mentioned cause issues? I'd like to toss in the 3D
Orthographic projection as well, if I'm not limited, or can force the user
to decide between WMS and Orthographic... I'll check other projections as
well.



>
>
> The remaining issues I have are:
>> (1) Repaint on resize: Our map is in a JInternalFrame, and it has an issue
>> - most prevalent on Solaris - in which if I resize the frame down, the map
>> appears to redraw once at the old size. I say redraw because the
>> JInternalFrame border fixes itself. If I force a redraw by moving any
>> JInternalFrame over the affected area, that are covered by the replacement
>> component is fixed. My next step on this issue is to add a ComponentListener
>> to the InternalFrame and try a revalidate() on the desktop - I've tried this
>> with repaint to no avail.
>>
>
> What is the component architecture in the JInternalFrame? Are you adding a
> MapBean directly, or are you using a BasicMapPanel or JPanel?
>
> Again, I've not see this, but I haven't really run with a MapBean in a
> JInternalFrame either.


I've explained the architecture above, and have yet to try that
revalidate().


>
>
> (2) Occasionally, Top-Most layers won't draw: Sometimes, when the bean is
>> created, it simply doesn't draw the top most layers. There's really no rhyme
>> or reason, and on average it appears to be 1-3 layers, but there is no
>> console entry. Often, at least one of these is a custom AbstractPlugIn.
>>
>
> Do they ever draw, after projection changes, etc? Do they draw if you
> add/remove a layer to/from the map?


Projection changes as in zooming/panning do not seem to fix it. I've tried
turning off the visibility of layers, but I've not tried removing them from
the LayerHandler. Note that this is seperate from the 'MaxZoomOut' issue...


>
>
> (3) Layer ordering: Also much more prevalent on Solaris, but I've seen it
>> on Linux as well. I can't seem to get OpenMap to ensure the order in which
>> layers are stacked programatically. At first, I thought it was the order
>> they were added. I've now moved on to using layerHandler.moveLayer(), which
>> works better, but still doesn't work. I assumed 0 for the lowest layer (for
>> example, WMS) and higher numbers get drawn on top. Is this right? Is there
>> something else I'm missing?
>>
>
> 0 is the top layer.
>
> What is the configuration of your OpenMap components? I mean, what
> components are you using to configure the map, and how? Are you using the
> MapHandler inside a BasicMapPanel, or are you trying to hook everything up
> yourself?


I rechecked my code, and I was using 0 as the top layer - my mistake was in
my question, not in my code. As I mentioned above, I'm hooking it all
together manually.


>
>
> Regards,
>
> Don
>
>
> Any other bugs I've got pretty easily tracked back to my own code. :)
>> Any help is greatly appriciated!
>> Shawn
>>
>> --
>> Shawn McNaughton
>> Software Engineer I, Raytheon IIS State College -
>> Shawn_G_McNaughton_at_raytheon.com mailto:Shawn_G_McNaughton_at_raytheon.com
>>
>

Thanks again,
Shawn
-- 
Shawn McNaughton
Software Engineer I, Raytheon IIS State College -
Shawn_G_McNaughton_at_raytheon.com
--
[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 Sun Jun 15 2008 - 15:21:55 EDT

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