Re: [OpenMap Users] Using OverViewMapHandler to create an overview map

From: Don Dietrick <dietrick@bbn.com>
Date: Mon Jan 27 2003 - 23:19:49 EST

Hi Luke,

It turns out there is a bug in OverviewMapHandler, where the projection
of the little map doesn't get initialized if setProperties() doesn't
get called. I've fixed the projection for future releases, but if you
call overviewMapHandler.setProperties(new Properties()), it should work
for you.

Regards,

Don

On Saturday, January 25, 2003, at 07:06 PM, Luke A. Catania ((TEC))
wrote:

> I am using the classes OverViewMapHandler & ShapeLayer in the API to
> display
> an overview map. I started out using the simplemap2.java and added to
> it
> until I created the complete OpenMap application using API calls
> rather then
> the properties file. It seems to work OK but when I select a
> rectangular
> area on the overview map it does not draw smoothly. The rectangle
> seems to
> disappear as I draw it. When I let go of the mouse button to finish
> drawing, the rectangle appears in the overview and the main map zooms
> appropriately. When I select another area, the map zooms again to the
> correct area but the previously selected area still has the rectangle
> showing in the overview map. Why does it not get erased? When I
> minimize
> the overview map and then open it up again the lines are erased. I
> guess
> probably from a repaint. Why are they not erased when I select an
> different
> area?
>
> A snip of the code is:
>
>
> Properties overviewLayerProps = new Properties();
> overviewLayerProps.put("prettyName", "CrrelView OverView");
> overviewLayerProps.put("lineColor", "ff000000");
> overviewLayerProps.put("fillColor", "ffbdde83");
> overviewLayerProps.put("shapeFile",
> "C:/CrrelView/Maps/dcwpo-browse.shp");
> overviewLayerProps.put("spatialIndex",
> "C:/CrrelView/Maps/dcwpo-browse.ssx");
> ShapeLayer overviewLayer= new ShapeLayer();
> overviewLayer.setVisible(true);
>
> overviewLayer.setProperties(overviewLayerProps);
> OverviewMapHandler overviewMapHandler = new
> OverviewMapHandler();
> overviewMapHandler.setScaleFactor(10);
> overviewMapHandler.setMinScale(10000000);
> ShapeLayer[] overviewLayers = {overviewLayer};
> overviewMapHandler.setLayers(overviewLayers);
> overviewMapHandler.setStatusLayer(new
> com.bbn.openmap.layer.OverviewMapAreaLayer());
>
> mapHandler.add(overviewMapHandler);
>
>
> Also when I resize the overview map I get the error:
>
> java.lang.NullPointerException:
> at com.bbn.openmap.gui.OverviewMapHandler.componentResized(Unknown
> Source)
> at java.awt.Component.processComponentEvent(Component.java:3042)
> at java.awt.Component.processEvent(Component.java, Compiled Code)
> at java.awt.Container.processEvent(Container.java, Compiled Code)
> at java.awt.Window.processEvent(Window.java:625)
> at java.awt.Component.dispatchEventImpl(Component.java, Compiled Code)
> at java.awt.Container.dispatchEventImpl(Container.java, Compiled Code)
> at java.awt.Window.dispatchEventImpl(Window.java, Compiled Code)
> at java.awt.Component.dispatchEvent(Component.java, Compiled Code)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java, Compiled Code)
> at
> java.awt.EventDispatchThread.pumpOneEventForComponent(EventDispatchThre
> ad.ja
> va, Compiled Code)
> at
> java.awt.EventDispatchThread.pumpEventsForComponent(EventDispatchThread
> .java
> :89)
> at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:84)
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:76)
>
> Luke
>
> --
> [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"]
>
>

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, BBN Technologies, dietrick@bbn.com
10 Moulton Street, Cambridge, MA 02138
617-873-3031 [fax]-2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[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 Jan 27 23:20:15 2003

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