Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Re: [Geotools-gt2-users] Question #4 - How is a displayed map organised?

Bernhard Kastner wrote:
Another question to be added to the FAQ as suggested in
http://lists.refractions.net/pipermail/udig-devel/2005-November/003189.html
----------

Hi,

am I assuming correctly, that a map, that has to be drawn, has a context, which symbolizes "the map"?
The Map is represented as a Map. To make life easier Jesse has defined a "Facade" object called a "context", indeed he defines one almost everytime he sets up a formal API. So a ToolContext has access to slightly different information then a RendererContext.

The use of this Context class is optional, it just contains helper methods to make your life easier.
So everything I do, I do on the context and the context is the representation (in the code) of the viewable map? Am I assuming correctly, that a context has a viewport, which is the current area I want to display? So if I zoom in, the viewport is getting smaller (in coordinates)? When I call repaint-function of the viewport, then the paint()-function of the renderer with the coordinates of the viewport, not the whole map, is being called?
The Map contains the definition of Layers, their Style and the Viewport. All of it is "just" a model. The editor provides the "view", the tools represent a "controller". Note - to handle threading issues the "Tools" are not supposed to hack the Map directly, they are to issue commands which will be run in the correct thread. We found we could not trust ourselves to always do the right thing, and made use of commands to prevent having the user interface freeze up everytime we made a mistake.

For more details please review:
-<http://udig.refractions.net/confluence/display/DEV/5+Working+with+GIS+Application>

In paticular I have added some pictures and a worked example to:
-<http://udig.refractions.net/confluence/display/DEV/7+Renderers>

Jody


Back to the top