Re: [OpenMap Users] Re-centre Map in 4.6.1

From: Don Dietrick <dietrick_at_bbn.com>
Date: Fri, 21 Jan 2005 11:17:42 -0500

Hi Mark,

How about calling _map.setCenter(lat, lon)?

You can get a handle to the MapBean from the findAndInit(Object obj)
method (the mapbean comes as an Object, you have to test and grab the
handle), but you can also grab the MapBean from the Projection object.

- Don


On Jan 21, 2005, at 3:35 AM, Gatrell, Mark (UK) wrote:

>
> Hi
> I have recently upgraded to v4.6.1 and have found that I now, can't
> re-centre my map programmatically.
>
> I was previously using this code:-
> ------------------------------------------
> MapBean _map;
>
> Proj proj = (Proj)getProjection().makeClone() ;
> proj.setCenter(newLatPosition,newLonPosition );
> _map.setProjection(proj);
>
> this.repaint();
>
> ------------------------------------------
>
> It would seem that I need to obtain the Mapbean some other way.. I
> have looked at the forum archive and the example uses the mouse event
> to obtain the MapBean using
>
> MapBean map = (MapBean)e.getSource():
>
> I am not using the mouse to trigger the change.. I am using the latest
> gps location read in from my receiver.
>
> Could anyone explain where I am going wrong ?
>
> I am trying to re-centre from my extended OmGraphicHandlerLayer!
>
> Thanks for your help
>
> Regards
>
> Mark.
>
> ********************************************************************
> This email and any attachments are confidential to the intended
> recipient and may also be privileged. If you are not the intended
> recipient please delete it from your system and notify the sender.
> You should not copy it or use it for any purpose nor disclose or
> distribute its contents to any other person.
> ********************************************************************
>
> --
> [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 Fri Jan 21 2005 - 11:19:52 EST

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