Information Technology

Minimal Example

This example show how little is needed.  We are using almost all the default values.  The only exception is the login division which we pass to the aMapApp3 object.  Without this all we get is a map, which is pretty useless.  As it is, initially only the administrator, whose account was created by the setup function, can login and add locations.  However, as new accounts are created, more people will have the ability to add to the map.

Note that we only need four divisions and two, the selection_container and the drag_container, wouldn't initially appear.

Green code is standard and can be cut and pasted into your application. 
Red code are values that are unique to the application. 
Grey code is the layout html.  You will have to change this to meet you needs.

<?php
require_once "/var/www/configs/SimpleMap_config.php";
require_once XAJAX_PATH."/xajax_core/xajax.inc.php";
$xajax = new xajax();
require_once UTILITY_LIBRARY;
require_once DB_DATABASE_LIBRARY;
dl_dbInit();
include(MAPAPP_PATH."/mapApp_xajaxFunctions.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
 $xajax->printJavascript(XAJAX_URL);
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MapApp Test</title>

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>

<?php
include MAPAPP_PATH."/mapAppObject.php";
?>
<script language="javascript">
function load() {
    myMapApp = new aMapAppObject(configObject =
                                                  new Object({
                                                             loginDiv:"login_container"
                                                         })
                                                   );                        
    
}
</script>
</head>

<body onLoad="load();">
<br />
&nbsp;&nbsp;&nbsp;<b>
Simple Map Example Page</b>
<br /><br />

<div id="select_container"></div>
<div id="map_container" style="width: 600px; height: 500px;"></div>
<div id="drag_container" style="position: absolute; z-index: 113; visibility: visible;
          left: 650px; top: 10px; width: 340px; height: 76px; display: block;"></div>
<div id="login_container" style="position: absolute; z-index: 113; visibility: visible;
          left: 650px; top: 250px; width: 340px; height: 76px; display: block;"></div>

</body>
</html>

Note that if we don't include the login div in the config object, we wouldn't need to define the select_container, the drag_container or the login_container.  But the result page would be useless until somehow the databases had already been populated.

The resulting page look like,

SimpleMap
Click on map to see full size image.