Code to generate this page:
include_once("../include/GoogleMap.php");
include_once("../include/JSMin.php");
//Map 1 $MAP1_DIRECTIONS_CONTAINER_ID = "map1_directions"; $MAP1_MAP_ID = "map1"; $MAP1_MAP_OBJECT = new GoogleMapAPI($MAP1_MAP_ID); $MAP1_MAP_OBJECT->_minify_js = isset($_REQUEST["min"])?FALSE:TRUE; $MAP_OBJECT->setDSN("mysql://user:[email protected]/db_name"); $MAP1_MAP_OBJECT->disableSidebar(); $MAP1_MAP_OBJECT->enableElevationDirections(); $MAP1_MAP_OBJECT->enableBikingDirections(); $MAP1_MAP_OBJECT->addDirections("Boulder, CO", "Flatirons Mall, Boulder, CO", $MAP1_DIRECTIONS_CONTAINER_ID, $display_markers=true); $MAP1_id_polyline_1 = $MAP1_MAP_OBJECT->addPolyLineByAddress("Boulder, CO", "Longmont, CO", $id=false,$color='#FF0000',$weight=2); $MAP1_POLYLINE_ELEVATION_ID = "MAP1_polyline_elevation_chart"; $MAP1_MAP_OBJECT->addPolylineElevation($MAP1_id_polyline_1,$MAP1_POLYLINE_ELEVATION_ID); //Map 2 $MAP2_DIRECTIONS_CONTAINER_ID = "map2_directions"; $MAP2_MAP_ID = "map2"; $MAP2_MAP_OBJECT = new GoogleMapAPI($MAP2_MAP_ID); $MAP2_MAP_OBJECT->_display_js_functions=false; $MAP2_MAP_OBJECT->_minify_js = isset($_REQUEST["min"])?FALSE:TRUE; $MAP_OBJECT->setDSN("mysql://user:[email protected]/db_name"); $MAP2_MAP_OBJECT->disableSidebar(); $MAP2_MAP_OBJECT->enableElevationDirections(); $MAP2_MAP_OBJECT->enableBikingDirections(); $MAP2_MAP_OBJECT->addDirections("Centennial, CO", "Englewood, CO", $MAP2_DIRECTIONS_CONTAINER_ID, $display_markers=true); $MAP2_id_polyline_1 = $MAP2_MAP_OBJECT->addPolyLineByAddress("Littleton, CO", "Denver, CO", $id=false,$color='#FF0000',$weight=2); $MAP2_POLYLINE_ELEVATION_ID = "MAP2_polyline_elevation_chart"; $MAP2_MAP_OBJECT->addPolylineElevation($MAP2_id_polyline_1,$MAP2_POLYLINE_ELEVATION_ID); ?> <html> <head> <?=$MAP1_MAP_OBJECT->getHeaderJS();?> <?=$MAP1_MAP_OBJECT->getMapJS();?> <?=$MAP2_MAP_OBJECT->getMapJS();?> <script type="text/javascript"> function loaded(){ <?=$MAP1_MAP_OBJECT->printOnLoadFunction();?>(); <?=$MAP2_MAP_OBJECT->printOnLoadFunction();?>(); } </script> </head> <body onLoad="loaded();"> <div id="<?=$MAP1_MAP_ID?>" style="float:left;width:<?=$MAP1_MAP_OBJECT->width?>;height:<?=$MAP1_MAP_OBJECT->height?>"></div> <div style="float:left"> <div id="elevation<?=$MAP1_DIRECTIONS_CONTAINER_ID?>"></div> <div id="<?=$MAP1_POLYLINE_ELEVATION_ID?>"></div> </div> <div style="clear:both;"></div> <div id="<?=$MAP2_MAP_ID?>" style="float:left;width:<?=$MAP2_MAP_OBJECT->width?>;height:<?=$MAP2_MAP_OBJECT->height?>"></div> <div style="float:left"> <div id="elevation<?=$MAP2_DIRECTIONS_CONTAINER_ID?>"></div> <div id="<?=$MAP2_POLYLINE_ELEVATION_ID?>"></div> </div> <div style="clear:both;"></div> </body> </html>