Rogue Wave JViews Maps Sample: Loading a Map into a Map Viewer
Description
This sample shows how to build a basic application that displays a map and makes use of the new mapping Beans.
How to Use the Sample
- Load an IVL file (not available in applet mode for applet security reasons).
By default, the file selection dialog shown when pressing the "load" button points to a sample map directory containing prebuilt maps.
You can also use the Map Builder to build your own map, save it as an IVL file, and then reload it using this example. - Navigation.
Once a file is loaded, moving the mouse around updates the coordinates in the locator window (bottom). You can also zoom in or out, possibly changing the appearance of the map, if the map was built using themes.
If the initial map makes use of load-on-demand features, or pixel-on-demand images, these will also be available in the application.
How to Run the Sample as an Application
This sample can also be run as an application. The installation directory contains an executable JAR file, loadmap.jar
, that allows you to execute the sample with a double click from a file browser. Note that if you are using Internet Explorer, you can open the installation directory and execute the JAR file from the browser. This technique may not work in other Web browsers.
Alternatively, you can run the sample application from the command line. First check that the Ant utility is properly configured. If not, see the instructions on how to configure Ant for Rogue Wave JViews.
Then, go to the installation directory of the sample and type:
ant run
Topics Covered
- Loading prebuilt map.
- Using JViews Maps Beans.
Detailed Description
This sample shows how to build a basic application that displays a map and makes use of the new mapping Beans.
It allows the user to load an IVL file, previously written by the Map Builder (or another application), display its legend, and the coordinates of the mouse.
Installation Directory
The Loading a Map into a Map Viewer sample is installed here.
Classes Involved
- ilog.views.maps.IlvCoordinateSystemProperty
- ilog.views.maps.beans.IlvJMouseCoordinateViewer
- ilog.views.maps.beans.IlvMapLegend
- ilog.views.maps.srs.coordsys.IlvGeographicCoordinateSystem