Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Tiled Rendering and Mapgraphics Again

Hi Emily:

Glad you hear you are making progress. Some comments inline:

On Tue, Apr 7, 2009 at 3:05 AM, Emily Gouge <egouge@xxxxxxxxxxxxxxx> wrote:
> Okay Jody it seems after re-organizing the plugins in my run menu I was able
> to find the New Page button you were referring to.  Seems odd though because
> I had all the printing plug-ins enabled.  Oh well.
>
> I updated and committed some changes to the Mapgraphic render as discuessed
> below.

That is great I will review next time I get a chance to update.

> I also made a fix to the LegendGraphic class.  I set the clip back to null
> when finished rendering.  This was done because if you tried to print a page
> with a legendgraphic then other mapgraphics above the legend graphic were
> not rendered properly because they were using the clip set by the
> legendgraphic.  It seems to all work well now.

That would make sense.

> I do have a question though - when I create the "New Page" I get another map
> as well as a this new page added to my project.  For example I'll start out
> with a countries map and then once I've hit the "New Page" button I see two
> countries map and a "page+countries" page.  Is this expected?  I find it
> rather odd behaviour.

I understand; the Page contains a copy of the original Map; we tried
having it "dynamically link" but then when the original map moved the
page would show a different area. By making this copy visible in the
project view users can open it up and change layers and so on (it
would be a smoother user experience if we could have all the map
editing tools available when the user selected just a Map Box  in the
Page Editor. Now that we have the MapViewer (and know how to adapt an
editor to an IMap etc...) perhaps this can be tackled? I am not sure
if there is anything wrong with having a "child" Map available in the
project view; I would kind of just like to have less stuff for the
user to worry about.

Jody

> Emily
>
>
>
>
> Jody Garnett wrote:
>>
>> It is either in the toolbar or the file menu (it only works when a map
>> editor is open and has focused).
>> Jody
>>
>> On Fri, Apr 3, 2009 at 9:09 AM, Emily Gouge <egouge@xxxxxxxxxxxxxxx>
>> wrote:
>>>
>>> Hello Jody,
>>>
>>> I'm slowly getting back into the udig mapgraphic rendering stuff.  I have
>>> looked at this and am happy to change the workflow as you have suggested.
>>>
>>> However I have one question regarding this statement:
>>> "to see the same bugs I am seeing open up a map and hit the "New Page"
>>> button in the toolbar"
>>>
>>> I don't see any 'New Page' button - what am I missing?
>>>
>>> Emily
>>>
>>>
>>> Jody Garnett wrote:
>>>>
>>>> Okay the problem was that the layer was null; no that does not make
>>>> much sense to me either :-)
>>>>
>>>> However the other way of looking at this is that Renderer has two
>>>> methods (one rendering onto a provided Graphics2D, and one for
>>>> rendering onto a raster held in the context).
>>>>
>>>> So we need to change your workflow a bit:
>>>> - MapGraphicRenderer.render( Graphics2D destination, IProgressMonitor
>>>> monitor ) should not use caching - it is "raw" and draws directly to
>>>> the provided destination
>>>> - MapGraphicRenderer.render( IProgressMonitor monitor ) is called to
>>>> render into the provided context; I think this may be where the code
>>>> for your cache can live? After it sets up the cache image it can use
>>>> the first method to draw into it?
>>>>
>>>> In anycase I am a bit confused on this one; to see the same bugs I am
>>>> seeing open up a map and hit the "New Page" button in the toolbar;
>>>> this will create a new page editor - and it is the MapPrinter box that
>>>> is having all this trouble.
>>>>
>>>> Jody
>>>>
>>>> On Sat, Mar 14, 2009 at 8:58 PM, Jody Garnett <jody.garnett@xxxxxxxxx>
>>>> wrote:
>>>>>
>>>>> Okay my first useful feedback - as part of the code sprint I am
>>>>> looking into printing in landscape mode.
>>>>>
>>>>> And one of your changes is producing a NPE.
>>>>>
>>>>> // this line is causing trouble when the renderer is used for printing
>>>>> //
>>>>> BlackboardItem cached =
>>>>>
>>>>>
>>>>> (BlackboardItem)getContext().getLayer().getBlackboard().get(BLACKBOARD_IMAGE_KEY);
>>>>>
>>>>> I am going to see what I can be done.
>>>>> Jody
>>>>>
>>>>>
>>>>> On Thu, Mar 5, 2009 at 11:01 AM, Emily Gouge <egouge@xxxxxxxxxxxxxxx>
>>>>> 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.
>>>>>>
>>>>>> 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.
>>>>>>
>>>>>> 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.
>>>>>>
>>>>>> 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.
>>>>>>
>>>>>> I could add another listener that listeners for style events and
>>>>>> clears
>>>>>> the
>>>>>> cache.
>>>>>>
>>>>>> Or maybe I could store information about the styles with my cached
>>>>>> image
>>>>>> and
>>>>>> if they have changed then refresh the cached mapgraphic.
>>>>>>
>>>>>> Emily
>>>>>>
>>>>>>
>>>>>> Jody Garnett wrote:
>>>>>>>
>>>>>>> Hi Emily.
>>>>>>> On Thu, Mar 5, 2009 at 9:48 AM, Emily Gouge <egouge@xxxxxxxxxxxxxxx>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> The ongoing issue of tiled rendering and mapgraphics is causing me
>>>>>>>> issues
>>>>>>>> again so I'm working on a solution.  (The mapgraphics currently
>>>>>>>> don't
>>>>>>>> render
>>>>>>>> properly if using tiled rendering).
>>>>>>>
>>>>>>> Good to hear you making progress on this; when you have a moment I am
>>>>>>> interested to hear what approach your solution is taking.
>>>>>>>
>>>>>>>> I currently have a solution that works most of the time.  The only
>>>>>>>> thing
>>>>>>>> it
>>>>>>>> doesn't do properly right now is refresh when the style is changed.
>>>>>>>
>>>>>>> Interesting. So the style changing would change the layer blackboard
>>>>>>> which
>>>>>>> would fire an event (or EMF Notification?). From their we need to
>>>>>>> check
>>>>>>> to
>>>>>>> see who is listening and make sure they issue a layer.refresh( null )
>>>>>>> event?
>>>>>>>
>>>>>>>> I'm wondering if somebody can review my proposed changes and provide
>>>>>>>> me
>>>>>>>> with some feedback and ideas for dealing with the style change issue
>>>>>>>> I'm
>>>>>>>> having.  If somebody is willing to review the code I'll pass it
>>>>>>>> along
>>>>>>>> to
>>>>>>>> them.
>>>>>>>
>>>>>>> I have a bit of a backlog on uDig items right now; so I cannot in
>>>>>>> good
>>>>>>> faith
>>>>>>> volunteer at this time (I still owe Anrdrea a style save api).
>>>>>>>
>>>>>>> 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
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>


Back to the top