Exemplo n.º 1
0
 */
 // get the start address
 $s = $_GET['sa'];
 // get the end address
 $e = $_GET['da'];
 if ($debug) {
     echo "sa: {$s}<br/>";
     echo "da: {$e}<br/>";
 }
 $starts = getLocations2($s);
 if ($debug) {
     echo "start locations:<br/>";
     print_r($starts);
     echo "<br/>";
 }
 $ends = getLocations2($e);
 if ($debug) {
     echo "end locations:<br/>";
     print_r($ends);
     echo "<br/>";
 }
 $start_station_marker = getMarker($_GET['start']);
 $end_station_marker = getMarker($_GET['end']);
 // find the path
 $path = findS2SPath($start_station_marker, $end_station_marker);
 // add two segments to the marker
 $start_location = $starts[0];
 $end_location = $ends[0];
 // add the segment directly to the Path.
 // shouldn't because it's a violation of abstraction, but I haven't developed the API yet.
 $start_marker = new Marker($start_location->point->lat, $start_location->point->lng, "start", $start_location->getAddressString());
Exemplo n.º 2
0
            if ($logging) {
                logS2SQuery($_GET['start'], $_GET['end']);
            }
            // find the path
            $path = findS2SPath($start_marker, $end_marker);
        }
    }
}
if ($type == 'location') {
    $loc = $_GET['l'];
    if ($location_string != null || $location_string != "") {
        $loc = $location_string;
    }
    // log
    if ($logging) {
        logLocationQuery($loc);
    }
    if ($debug) {
        echo "location={$loc}<br/>";
    }
    $loc = fixSearchString($loc);
    // check for new york and ny
    $fix_loc = checkString($loc, $city);
    $fix_loc = checkString($fix_loc, $state);
    $locations = getLocations2($fix_loc);
    if (count($locations) == 1) {
        // grab stations
        $stations = findNearestStations2($locations[0]);
    }
}
echo "<!-- type is /" . $type . "/ -->\n";