Google マップの PHP クライアントが正しく動作するように作業を進めています。
GitHub:https://github.com/google/google-api-php-clientから GoogleAPI PHP クライアントのローカル コピーをダウンロードしました。
IIS8 で PHP v5.4 を実行しています。GoogleAPI は、 GoogleAPIの下の PHP Include フォルダーにインストールされました。
PHP は、他のすべてのスクリプトで正しく動作します。
Maps-Engine Documentationからサンプルを動作させようとしています。
<?php
ini_set('display_errors','on');
require('GoogleAPI/autoload.php');
//require_once 'GoogleAPI/src/Google/Client.php';
//require_once 'Google/Service/MapsEngine.php';
$apiKey = "API Key";
$client = new Google_Client();
$client->setApplicationName("Google-PhpMapsEngineSample/1.0");
$client->setDeveloperKey($apiKey);
$service = new Google_Service_MapsEngine($client);
$optParams = array('maxResults' => 500, 'version' => 'published');
$results = $service->tables_features->listTablesFeatures("12421761926155747447-06672618218968397709", $optParams);
print_r($results);
?>
私が受け取る出力は次のとおりです。
Fatal error: Class 'Google_Service_MapsEngine_MapItem' not found in C:\Program Files (x86)\PHP\v5.4\includes\GoogleAPI\src\Google\Service\MapsEngine.php on line 4702
MapsEngine:4702 は Google_Service_MapsEngine_MapItem クラスを拡張します。Google_Service_MapsEngine_MapItem クラスは、Model.php ファイルで定義された Google_Model クラスを拡張します。