This panel also provides interesting static utility methods
to manage the preview images and the creation of the area of interest.
To create an area for everything visible on the view
(this is the method usually called when clicking the New Area of Interest button), you can
insert the following lines of code in your application:
IlvAreaOfInterest
currentArea=IlvJAreaOfInterestPanel.createLocationFromView(view,64,false);
currentArea.setName("Current Area");
If you want the users to provide the area name themselves
(by means of a dialog box) use:
IlvAreaOfInterest
currentArea=IlvJAreaOfInterestPanel.createLocationFromView(view,64,true);
This bean also provides a method that updates the area
of interest preview icon with what would be visible with the current
map settings and contents:
IlvJAreaOfInterestPanel.refreshPreview(view,area,maxDimension);
For example:
To create an area for Europe bounds:
IlvRect rectangle=new
IlvRect((float)Math.toRadians(15),(float)Math.toRadians(35),(float)Math.toRa
dians(45),(float)Math.toRadians(25));
IlvAreaOfInterest europe=new IlvAreaOfInterest("Europe",rectangle,0,null);
To update its preview image:
IlvJAreaOfInterestPanel.refreshPreview(view,europe,64);
You would then have to add the area
to the property of the manager for proper management by the Area of
Interest bean:
IlvAreaOfInterestVector
areas=IlvAreasOfInterestProperty.GetAreasOfInterest(view.getManager());
areas.addElement(europe);