Thanks Emily - this answers my question on if a new "internal" release is needed for testing this weekend (if you read the other email threads I was going to make the decision by talking to you).
Jody

Emily Gouge wrote:
I've committed my updates to the MapgraphicContext and MapGraphicRnederer that allow mapgraphics to work "correctly" with the tiled rendering system. There is another performance improvement fix coming soon.

If anybody has problems with mapgraphics rendering incorrectly please let me know.

Emily

Jody Garnett wrote:
Um I thought that hit the rendering system directly; is it not in the same
category as start / stop / rendering etc....?
I think I remember you explaining how layer refresh worked to me last year.
Jody

On Fri, Mar 6, 2009 at 6:01 AM, Emily Gouge <[email protected]> wrote:

I agree I need to listen to layer.refresh() "events" but I don't believe
there are any events fired with layer.refresh() is called.  Maybe I'm
missing something.


Jody Garnett wrote:

On Thu, Mar 5, 2009 at 11:01 AM, Emily Gouge <[email protected]>
wrote:

 Hey Jody,
What I have done is update the Mapgraphic Renderer to render the entire
viewport onto a single image.  This image is then stored on the layer
blackboard and used when rendering tiles. When the tile comes along to render the mapgraphic the image is taken off the blackboard and the part
that matches the tiles bounds are clipped and drawn.


Yeah cool - I like that approach - nice work. If we are smart when we
define
MapGraphic2 we may be able to define a smaller image (along with the
screen
location the image should be drawn in).

We may also find it useful to split up ScreenGraphic from MapGraphic (and have screen graphic always work in screen coords; and MapGraphic work in some data coords (we could default to DefaultGeoGraphicCRS.WGS84 to make
examples easy to write).

In anycase I like the approach you describe.

 In order to make this work; when the mapgraphic context is created a
viewport listener is added to the map so when the viewport bounds change
the
image cached on the layer's blackboard is cleared.


Smart. You could also consider using the MapGraphicRenderer - because it
is
a Renderer it has lifecycle methods (ie is stateful) and you can
add/remove
your viewport listener there.

 The issues with the styling is not that layer.refresh() is not being
called
but rather that this doesn't cause my "cached" mapgraphic image on the
blackboard to be cleared.


I see so we have one step remaining to do ... when the MapGraphicRenderer
 gets a layer refresh event it needs to clear this image. It is the
Renderer
that would have this responsibility rather than the MapGraphic
implementations themselves.

That is the next step right? Am I missing something?


A simple solution would be do not cache this image; but I can't imagine
that would be very good performance wise as it would be rendering the
image
multiple times.


Agreed.

I could add another listener that listeners for style events and clears
the

cache.


Apparently I am not missing something; you have the same idea - I would
listen to layer.refresh events rather than style events. Style change
events
trigger a layer refresh event do they not?

Or maybe I could store information about the styles with my cached image
and if they have changed then refresh the cached mapgraphic.


The style blackboard provides the notification; many of the style objects
are just simple data structures (and thus hard to watch change).

Cheers,
Jody



------------------------------------------------------------------------

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel



------------------------------------------------------------------------

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to