There is a method that is provided by the GiCentre which uses a class called
zoomPan.
To use this feature you need to download from the GiCentre site using this link
now you need to choose a class
ZoomPan zoomer
now create an instance of the zoom class. This need to be placed within the void setup() method.
eg zoomer = new ZoomPan(this); // keyword this points to the zoomPan object
now you need to place zoomer.transform(); in the draw method. Remember the draw method is called again and again.
Now lets look at another features. There is feature that runs whats inside a particular loop
// if you want a certain task to be accomplished for example writing to appears on circles
if(zoomer.getZoomScale() > 3) // the greater then 3 refers to how much you have zoom in
/* if you want to find out what your current zoomed position is you can use the print command
to return the current position
*/
println(zoomer.getZoomScale)
{
text(countryName, x+pixel, y);
}
Exercises
1. develop a zoom function which draw a group of triangle whens you have zoomed in with positon level 3
2. make a button which when clicked on will zoom in to a particular position
3. disable the mouse panning and only allow the mouse scrole to work
Monday, 14 February 2011
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Step 1: First you need to download and install python. You can get a python installation from http://www.python.org/download/ Step 2: now...
-
In this file i purposely made mistakes to see what would happen. I hope this helps
-
to settup the database for Django step 1: go to the settings file ENGINE': 'django.db.backends.sqlite3', # Add 'postgresq...
No comments:
Post a Comment