Build AJAX-Based Web Maps Using ka-Map
by Tyler Mitchell
|
Pages: 1, 2, 3, 4, 5, 6
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:
http://localhost:8080/ka-map/
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
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.