Re: mapbeans

From: Don Dietrick <dietrick@bbn.com>
Date: Wed Mar 06 2002 - 08:57:18 EST

Hi Catherine,

There are a couple of ways, depending on what kind of object needs the
handle. The easiest way for a Layer to get a handle to the MapBean is
to ask the ProjectionEvent that arrives in the projectionChanged()
method for it's source, which is the MapBean.

For Layers and other objects, you can add the object to the MapHandler,
and use the findAndInit(Object) method to search for the MapBean as it
gets added to the MapHandler. Your object should implement the methods
in the com.bbn.openmap.MapHandlerChild abstract class. You can note
those methods and then check out, say, the
com.bbn.openmap.MouseDelegator to see how it uses them to grab a handle
to the MapBean.

Layers already do this, so for them, all you have to do is
setAddToBeanContext(true), or set the layer.addToBeanContext=true
property in the openmap.properties file, and then override the
findAndInit(Object) method to look for the object you need. If you need
a Layer to have a handle to the MapBean before the layer is added to the
MapBean, you'll need to do this because a Layer only receives
ProjectionEvents when it is part of the map.

Hope this helps,

Don

On Wednesday, March 6, 2002, at 01:25 AM, Howard, Catherine wrote:

> Hi,
> How do you get a handle on the MapBean? I am trying to get OpenMap
> to focus on a particular area of interest using lat/lon values in my
> code
> (rather than a mouse event).
> Thanks
> Catherine
>
> --
> [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, dietrick@bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[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 Wed Mar 6 09:00:16 2002

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