コード例 #1
0
<?php

require 'common.php';
include 'header.php';
?>

<div id="chartdiv">
<script id="primaryscript">
function genAllChart() {
    var chart = AmCharts.makeChart("chartdiv", {
        <?php 
echo retAll();
?>
        "legend": {
            "equalWidths": false,
            //"periodValueText": "total: [[value.sum]]",
            "position": "bottom",
            "valueAlign": "left",
            //"valueWidth": 100
        },
        "offset":30,
        "valueAxes": [{
            "stackType": "regular",
            "gridAlpha": 0.07,
            "position": "left",
            //"title": "Speed", // TODO -- add y axis???
        }],
        "graphs": [{
            "balloonText": "P <b>[[value]]</b></span>",
            "fillAlphas": 0.6,
            "lineAlpha": 0.4,
コード例 #2
0
<?php

// Testing...
// http://mcphp/PHPDEV/appraisal/ms-geocodesdk.php?geoAddress=1646 Linden Memphis TN
//$query = "1646 Linden Avenue Memphis TN 38104";
if (!empty($_POST)) {
    $query = $_POST["geoAddress"];
} else {
    $query = $_GET["geoAddress"];
}
//
if ($query != '') {
    echo retAll($query);
}
function retAll($query)
{
    $result = geoParseAdd($query);
    return json_encode($result);
}
// parse nasty address like "1646 linden memphis tn" ...
// ... then return PHP array of following
//    Displayname: 1642 Linden Ave, Memphis, TN 38104-3825
//    FormattedAddress: 1642 Linden Ave, Memphis, TN 38104-3825
//    AddressLine: 1642 Linden Ave
//    Locality: Memphis
//    AdminDistrict: TN
//    PostalCode: 38104-3825
//    CountyRegion: United States
//    District:
//    PostalTown:
//    Latitude: 35.134334