Re: [OpenMap Users] OMScalingRaster continued

From: Don Dietrick <dietrick_at_bbn.com>
Date: Fri, 10 Sep 2004 07:47:30 -0400

Hi David,

You want to call generate() when the projection changes, not
regenerate(). generate() forces the OMGraphic to look at the
projection and reposition itself, regenerate() calls generate() only if
the OMGraphic thinks its parameters have changed. regenerate() is
something you use when you change position of some of your OMGraphics
and the projection hasn't changed, so only those OMGraphics that have
changed actually bother doing anything.

- Don

On Sep 10, 2004, at 3:40 AM, Marklund David wrote:

> Hi all,
> I have a layer with a OMScalingRaster.
> The raster seems not to follow the other layers projection changes
> accurately. I have a pixel in the layer that I can follow when zooming
> and panning, and that pixel does not follow the other layers.
>
> openmap.Projection=mercator
>
>
> This is the code that creates the raster:
>
> ---8<---
>
> LatLonPoint lr = itsProjection.getLowerRight();
> LatLonPoint ul = itsProjection.getUpperLeft();
> omRaster = new OMScalingRaster(ul.getLatitude(),
> ul.getLongitude(), lr.getLatitude(), lr.getLongitude(),
> image.image);
>
>
> omRaster.generate(itsProjection);
>
> --->8---
>
> This is the projectionChanged method of the layer
>
> ---8<---
> public void projectionChanged(ProjectionEvent e) {
>
> itsProjection = e.getProjection();
> if ((e.getProjection() != null) && (omRaster != null)) {
> omRaster.regenerate(e.getProjection());
> }
>
> repaint();
> fireStatusUpdate(LayerStatusEvent.STATUS_UPDATE);
> }
> --->8---
>
>
> Any ideas anyone ?
>
> //David
>
> --
> [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 Sep 10 2004 - 07:49:10 EDT

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