Re: function definitions

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: function definitions

Martin Schmitz
Hello,

setContext(.) defines the "context" which holds the displayed layers

setMapArea(.) defines the area to zoom to

isReset(.) checks whether setReset(true) was previously called, so every
layer is updated on next repaint(); without setReset(true) changes on
layers (e.g. new features) do not become visible (as my experience is!)

Kind regards

Martin Schmitz

nvidia schrieb:

> Hi,
>
>     would somebody kindly explain what the following functions do:
>
> public void setContext(MapContext context)
>
> public void setMapArea(Envelope mapArea)
>
> public boolean isReset();
>
> because i can't find any description of this in the user guide with
> referrence to using a JMapPane or even in API
> http://javadoc.geotools.fr/2.3/org/geotools/gui/swing/JMapPane.html which i
> found was not greate
> :(.
>
>
> Cheers




------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Reply | Threaded
Open this post in threaded view
|

Re: function definitions

jody.garnett
Thanks Martin; I have updated the wiki page - http://docs.codehaus.org/display/GEOTDOC/MapPane

I grabbed a code example from the earlier welcome page 09 ShapeLab

On Mon, Feb 16, 2009 at 9:35 AM, Martin Schmitz <[hidden email]> wrote:
Hello,

setContext(.) defines the "context" which holds the displayed layers

setMapArea(.) defines the area to zoom to

isReset(.) checks whether setReset(true) was previously called, so every
layer is updated on next repaint(); without setReset(true) changes on
layers (e.g. new features) do not become visible (as my experience is!)

Kind regards

Martin Schmitz

nvidia schrieb:
> Hi,
>
>     would somebody kindly explain what the following functions do:
>
> public void setContext(MapContext context)
>
> public void setMapArea(Envelope mapArea)
>
> public boolean isReset();
>
> because i can't find any description of this in the user guide with
> referrence to using a JMapPane or even in API
> http://javadoc.geotools.fr/2.3/org/geotools/gui/swing/JMapPane.html which i
> found was not greate
> :(.
>
>
> Cheers




------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Reply | Threaded
Open this post in threaded view
|

Re: function definitions

mbedward
In reply to this post by Martin Schmitz
Just to clarify the setReset method...

Martin is quite right that it tells the map pane to update all layers.
 Included in this is a recalculation of the display scale.  If you
replace a layer (e.g. display a shapefile, then delete that layer and
swap to another shapefile) without calling setReset you can get a
distorted display of the features because the scale variables have not
been correctly recalculated.

If you are just chaning features within a vector layer (points,
lines, polygons) then you shouldn't need to call setReset to see the
changes.

But "setReset"... it's a terrible name for a method :-)

Michael

2009/2/16 Martin Schmitz <[hidden email]>:

> Hello,
>
> setContext(.) defines the "context" which holds the displayed layers
>
> setMapArea(.) defines the area to zoom to
>
> isReset(.) checks whether setReset(true) was previously called, so every
> layer is updated on next repaint(); without setReset(true) changes on
> layers (e.g. new features) do not become visible (as my experience is!)
>
> Kind regards
>
> Martin Schmitz
>
> nvidia schrieb:
>> Hi,
>>
>>     would somebody kindly explain what the following functions do:
>>
>> public void setContext(MapContext context)
>>
>> public void setMapArea(Envelope mapArea)
>>
>> public boolean isReset();
>>
>> because i can't find any description of this in the user guide with
>> referrence to using a JMapPane or even in API
>> http://javadoc.geotools.fr/2.3/org/geotools/gui/swing/JMapPane.html which i
>> found was not greate
>> :(.
>>
>>
>> Cheers
>
>
>
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Geotools-gt2-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Reply | Threaded
Open this post in threaded view
|

Re: function definitions

jody.garnett
How would you fell about dragging JMapPane into renderer? Is it something you use Michael?
It is a common; and annoying example; that has not seen any review thus far.

Jody

On Mon, Feb 16, 2009 at 10:26 AM, Michael Bedward <[hidden email]> wrote:
Just to clarify the setReset method...

Martin is quite right that it tells the map pane to update all layers.
 Included in this is a recalculation of the display scale.  If you
replace a layer (e.g. display a shapefile, then delete that layer and
swap to another shapefile) without calling setReset you can get a
distorted display of the features because the scale variables have not
been correctly recalculated.

If you are just chaning features within a vector layer (points,
lines, polygons) then you shouldn't need to call setReset to see the
changes.

But "setReset"... it's a terrible name for a method :-)

Michael

2009/2/16 Martin Schmitz <[hidden email]>:
> Hello,
>
> setContext(.) defines the "context" which holds the displayed layers
>
> setMapArea(.) defines the area to zoom to
>
> isReset(.) checks whether setReset(true) was previously called, so every
> layer is updated on next repaint(); without setReset(true) changes on
> layers (e.g. new features) do not become visible (as my experience is!)
>
> Kind regards
>
> Martin Schmitz
>
> nvidia schrieb:
>> Hi,
>>
>>     would somebody kindly explain what the following functions do:
>>
>> public void setContext(MapContext context)
>>
>> public void setMapArea(Envelope mapArea)
>>
>> public boolean isReset();
>>
>> because i can't find any description of this in the user guide with
>> referrence to using a JMapPane or even in API
>> http://javadoc.geotools.fr/2.3/org/geotools/gui/swing/JMapPane.html which i
>> found was not greate
>> :(.
>>
>>
>> Cheers
>
>
>
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Geotools-gt2-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Reply | Threaded
Open this post in threaded view
|

Re: function definitions

mbedward
Just got through typing my long-winded post before seeing your
straight-to-the-point one :-)

I think it's a good idea.  Happy to help.

Michael

2009/2/16 Jody Garnett <[hidden email]>:
> How would you fell about dragging JMapPane into renderer? Is it something
> you use Michael?
> It is a common; and annoying example; that has not seen any review thus far.
>
> Jody
>

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Reply | Threaded
Open this post in threaded view
|

Re: function definitions

jody.garnett
I have set up office hours (http://docs.codehaus.org/display/GEOT/3+Communication) but they are mostly set up for Europe and Australia. Do you want to just communicate on the developers list for this one?

Jody

On Mon, Feb 16, 2009 at 10:46 AM, Michael Bedward <[hidden email]> wrote:
Just got through typing my long-winded post before seeing your
straight-to-the-point one :-)

I think it's a good idea.  Happy to help.

Michael

2009/2/16 Jody Garnett <[hidden email]>:
> How would you fell about dragging JMapPane into renderer? Is it something
> you use Michael?
> It is a common; and annoying example; that has not seen any review thus far.
>
> Jody
>

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Reply | Threaded
Open this post in threaded view
|

Re: function definitions

mbedward
In reply to this post by mbedward
setMapArea, um, sets the map area :-)

Specifically, it's just a setter method for the mapArea field (= class
variable) in JMapPane.  Next time the display is due to be repainted,
mapArea is passed as an argument to the object that does the
drawing...

http://javadoc.geotools.fr/2.5/org/geotools/renderer/GTRenderer.html#paint(java.awt.Graphics2D,%20java.awt.Rectangle,%20com.vividsolutions.jts.geom.Envelope)

As for zooming in with a mouse click... You've got the right idea.
The click triggers a listener method; a rectangle is calculated that's
centred on the click location and half the size of the current map
area; and the world coords of this rectangle become the new map area.

Hope that helps

Michael

2009/2/18 nvidia <[hidden email]>:

>
> Hi,
>
>  thanks for the explanation, although i am curious to know, the function
> setMapArea(), how does it actually zoom in? because i understand that it
> defines the area to zoom into, but HOW does it do that?
>
> My guess would be that it listens for the mouse click, which would invoke a
> mouseclick listener or something like that and increase the size of the area
> that was click giving the zoomin impression.
>
>
> cheers
>
> Michael Bedward wrote:
>>
>> Just to clarify the setReset method...
>>
>> Martin is quite right that it tells the map pane to update all layers.
>>  Included in this is a recalculation of the display scale.  If you
>> replace a layer (e.g. display a shapefile, then delete that layer and
>> swap to another shapefile) without calling setReset you can get a
>> distorted display of the features because the scale variables have not
>> been correctly recalculated.
>>
>> If you are just chaning features within a vector layer (points,
>> lines, polygons) then you shouldn't need to call setReset to see the
>> changes.
>>
>> But "setReset"... it's a terrible name for a method :-)
>>
>> Michael
>>
>> 2009/2/16 Martin Schmitz <[hidden email]>:
>>> Hello,
>>>
>>> setContext(.) defines the "context" which holds the displayed layers
>>>
>>> setMapArea(.) defines the area to zoom to
>>>
>>> isReset(.) checks whether setReset(true) was previously called, so every
>>> layer is updated on next repaint(); without setReset(true) changes on
>>> layers (e.g. new features) do not become visible (as my experience is!)
>>>
>>> Kind regards
>>>
>>> Martin Schmitz
>>>
>>> nvidia schrieb:
>>>> Hi,
>>>>
>>>>     would somebody kindly explain what the following functions do:
>>>>
>>>> public void setContext(MapContext context)
>>>>
>>>> public void setMapArea(Envelope mapArea)
>>>>
>>>> public boolean isReset();
>>>>
>>>> because i can't find any description of this in the user guide with
>>>> referrence to using a JMapPane or even in API
>>>> http://javadoc.geotools.fr/2.3/org/geotools/gui/swing/JMapPane.html
>>>> which i
>>>> found was not greate
>>>> :(.
>>>>
>>>>
>>>> Cheers
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
>>> CA
>>> -OSBC tackles the biggest issue in open source: Open Sourcing the
>>> Enterprise
>>> -Strategies to boost innovation and cut costs with open source
>>> participation
>>> -Receive a $600 discount off the registration fee with the source code:
>>> SFAD
>>> http://p.sf.net/sfu/XcvMzF8H
>>> _______________________________________________
>>> Geotools-gt2-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>>
>>
>> ------------------------------------------------------------------------------
>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
>> CA
>> -OSBC tackles the biggest issue in open source: Open Sourcing the
>> Enterprise
>> -Strategies to boost innovation and cut costs with open source
>> participation
>> -Receive a $600 discount off the registration fee with the source code:
>> SFAD
>> http://p.sf.net/sfu/XcvMzF8H
>> _______________________________________________
>> Geotools-gt2-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>>
>
> --
> View this message in context: http://n2.nabble.com/function-definitions-tp2331677p2345732.html
> Sent from the geotools-gt2-users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Geotools-gt2-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Reply | Threaded
Open this post in threaded view
|

Re: function definitions

mbedward
2009/2/23 nvidia <[hidden email]>:
>
> In terms of zoom in bit of the function, is a description of how it does this
> on any of the documentation found on the website?

No, you have to look at the source code.  But it's not hard to follow.

Michael

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users