Testing the Basic Application
From Ka-Map Wiki
much of the text of this page is from Tyler Mitchell article Build AJAX-Based Web Maps Using ka-Map .
 Testing the Basic Application
If you've made changes to your web server configuration (e.g. set up new aliases) then you need to restart the web server.
 Restart the Web Server
With FGS, it's as easy as initializing the FGS environment and then stopping-and-starting the FGS server:
> . /opt/fgs/setenv.sh
- FGS runtime ready in '/opt/fgs', use fgs command.
> fgs stop /opt/fgs/etc/init.d/apache stop: httpd stopped
> fgs start Processing config directory: /opt/fgs/www/conf.d/*.conf Processing config file: /opt/fgs/www/conf.d/kamap.conf /opt/fgs/etc/init.d/apache start: httpd started
With MS4W you need to stop and restart the Apache process. This often runs as an application in its own command window. You can open that window and press the CTRL+C key combination to stop the Apache web server. Then start it again by launching the apache.exe file found in C:\ms4w\apache\. If Apache was installed as a service, then it can be restarted using the Services application in the Windows Control Panel, under Administrative Tools.
 Load Map
Now you should be able to access your map using a modern web browser. Firefox and Internet Explorer work well with this example. Safari web browser on OS X seemed to only partially work as some of the page layout was broken.
Open up the URL to the ka-Map instance. For example, with the default FGS install you would open:
When you install FGS, you are asked what port the web server should run on. The default is 8080. With MS4W it defaults to port 80. The port number in the URL should be replaced by your web server port, or left blank if it is running on the default port 80.
Figure 1 is a screenshot of Firefox displaying the initial map. Adding the key/reference map in the lower-right corner will be introduced in another section.
Figure 1. Initial web page view of tutorial application http://www.xml.com/2005/08/10/graphics/figure1.jpg
Be patient the first time around, as it may take a minute to get started. Each time you zoom in it will create a new master map, tile it up into tiny chunks, and store it on the server. Then it will send you just the pieces that you need.
 Navigating the World
The interface is simple. Click Zoom In for more detail and Zoom Out for less. The image data used in this example is very low resolution, so zooming in doesn't look that great. But, you have the option of using any data you want for your application.
When you want to centre the map on a particular location, you have two choices. You can click-and-drag the map around until the area of interest is in the middle of the map. Then zoom in more if you'd like to see that area in detail.
Another way to move the map around is by quickly double-clicking on a location. This will automatically center the map on that location -- it's a neat effect.
Keyboard shortcuts include the plus (+) and minus (-) keys for zooming in and out. You can also use Page Up, Page Down, Home, End, and the arrow keys to pan the map. Click on the map once first to enable these controls.
 Adding a Key/Reference Map
You don't need to have a reference in your application, but to add one you need a REFERENCE section in the global.map file. You can add it right after the SCALEBAR...END section:
REFERENCE EXTENT -180 -90 180 90 SIZE 241 121 IMAGE data/keymap.png COLOR -1 -1 -1 OUTLINECOLOR 255 0 0 END
This example requires a reference map image named keymap.png to be saved with the cloud image and shapefiles in the data folder. You can download Figure 2 and use it for your reference map image.
Figure 2. Reference map image (keymap.png) http://www.xml.com/2005/08/10/graphics/keymap.jpg
ka-Map will automatically show the current extent of the map using a red box on top of the reference map, as shown in Figure 1.