Example #1
0
function map($type, $data)
{
    switch ($type) {
        case 'location':
            mapLocation($data[0], $data[1]);
            break;
        case 's2s':
            break;
        case 'dir':
            break;
    }
}
Example #2
0
<?php

#
#   Code copyright 2005-2008 Michael Ho
#   Algorithm copyright 2008 Jason Gu and Michael Ho
#   Unauthorized reproduction of this code and algorithm are prohibited by law.
#
#   map.php
#   This file contains the logic to determine what code to display. Called from index.php
#
// location search
if ($type == 'location') {
    //if (count($locations) == 1) {
    mapLocation($locations, $stations);
    //}
} else {
    if ($type == 's2s') {
        //mapPath($path, $cpath);
        if ($path != "walk" || $path != "same") {
            mapPath($path->path, $cpath);
        }
        // mark marker
        markMarker($start_marker, $start_marker_img, "start");
        markMarker($end_marker, $end_marker_img, "end");
        // center on start
        $lng = $start_marker->getLng();
        $lat = $start_marker->getLat();
        echo "map.setCenter(new GLatLng({$lat},{$lng}), {$default_zoom});\n";
    } else {
        if ($type == 'dir' || $type == 'dir_alt') {
            // plot starting point