I don't know if this will help or not but I do the same sort of position
following with the attached intelligentScroll method. This is in my
MapFrame (which contains the MapBean). It is a method called from a timer
routine which ticks every 250ms. It repositions the cursor showing the
current position. If the cursor is within 10% of the visible edge of the
map the map is repositioned so that it is centred around the current
position otherwise the cursor is shifted.
The effect is that the cursor moves across the map smoothly until it gets
near the edge and then the whole map scrolls to re-centre on the cursor.
It sounds a bit strange but the users get used to it very quickly and
learn to anticipate the jump without thinking about it. I did, at first,
have the map continuously re-centre on the cursor but the users didn't
like that. They found it hard to spot the current position cursor even
though it was stationary and they also found it hard to locate themselves
as the map was constantly moving.
The NIPoint parameter is a class which holds the latlon, x,y and other
information for my application.
Hope that helps.
regards,
Adrian
_____________________________________________
Dr. Adrian Lumsden
Product Specialist
Scientific Software and Systems Limited
Tel: +64 4 917-6680 (direct)
+64 4 917-6670 (reception)
Fax: +64 4 917-6671
E-mail: Adrian.Lumsden@spamtrap.sss.co.nz
Visit us on the Web at: http://www.sss.co.nz
_____________________________________________
This e-mail passed SSS's content security scan.
It is covered by the confidentiality clauses at
http://www.sss.co.nz/content_and_confidentiality
Don Dietrick <dietrick@bbn.com>
Sent by: owner-openmap-users@bbn.com
19/02/04 08:40
To: P Jaya Sunderam <jspothar@cs.uccs.edu>
cc: openmap <openmap-users@bbn.com> (E-mail)
Subject: Re: [OpenMap Users] follow icon
I thought Brian Hudson's reply to your query yesterday was right on!
- Don
On Feb 18, 2004, at 2:29 PM, P Jaya Sunderam wrote:
>
> hi Don,
> i am trying to follow the icon as it moves out of the viewwing
> window.following is the code for icon moving.any suggestion how to
> follow
> it.
> gpsDevice.setLat(gps_lat++);
> gpsDevice.setLon(gps_lon++);
>
> //setCenter(gps_lat,gps_lon);
> gpsDevice.regenerate(getProjection());
> repaint();
> thanks
> jay
>
>
> --
> [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"]
>
-- [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"]
-- [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"]
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:37 EDT