PHP中的Google Maps引擎API Hello World示例导致找不到MapItem
我正试图通过让PHP客户端的谷歌地图工作正常 我已经从下载了GoogleAPI PHP客户端的本地副本 我正在IIS8上运行PHPV5.4。GoogleAPI安装在PHP Include文件夹中,位于GoogleAPI下 PHP可以正确地与我的所有其他脚本一起工作 我正在努力让这个例子发挥作用PHP中的Google Maps引擎API Hello World示例导致找不到MapItem,php,google-maps,google-api-php-client,google-maps-engine,Php,Google Maps,Google Api Php Client,Google Maps Engine,我正试图通过让PHP客户端的谷歌地图工作正常 我已经从下载了GoogleAPI PHP客户端的本地副本 我正在IIS8上运行PHPV5.4。GoogleAPI安装在PHP Include文件夹中,位于GoogleAPI下 PHP可以正确地与我的所有其他脚本一起工作 我正在努力让这个例子发挥作用 你好,我也有同样的问题 google api php client/src/google/Service/MapsEngine.php文件中有一个bug。在声明类别Google_Service_Maps
你好,我也有同样的问题 google api php client/src/google/Service/MapsEngine.php文件中有一个bug。在声明类别Google_Service_MapsEngine_MapItem之前,将声明类别Google_Service_MapsEngine_MapItem之外的类别Google_Service_MapsEngine_MapFolder 我在MapsEngine.php文件中切换了两个类的顺序,这就解决了问题。这显示了类的正确顺序
class Google_Service_MapsEngine_MapItem extends Google_Model
{
protected $internal_gapi_mappings = array(
);
public $type;
public function setType($type)
{
$this->type = $type;
}
public function getType()
{
return $this->type;
}
}
class Google_Service_MapsEngine_MapFolder extends Google_Service_MapsEngine_MapItem
{
protected $collection_key = 'defaultViewport';
protected $internal_gapi_mappings = array(
);
protected $contentsType = 'Google_Service_MapsEngine_MapItem';
protected $contentsDataType = 'array';
public $defaultViewport;
public $expandable;
public $key;
public $name;
public $visibility;
protected function gapiInit()
{
$this->type = 'folder';
}
public function setContents($contents)
{
$this->contents = $contents;
}
public function getContents()
{
return $this->contents;
}
public function setDefaultViewport($defaultViewport)
{
$this->defaultViewport = $defaultViewport;
}
public function getDefaultViewport()
{
return $this->defaultViewport;
}
public function setExpandable($expandable)
{
$this->expandable = $expandable;
}
public function getExpandable()
{
return $this->expandable;
}
public function setKey($key)
{
$this->key = $key;
}
public function getKey()
{
return $this->key;
}
public function setName($name)
{
$this->name = $name;
}
public function getName()
{
return $this->name;
}
public function setVisibility($visibility)
{
$this->visibility = $visibility;
}
public function getVisibility()
{
return $this->visibility;
}
}
运行此命令时,您是否注释掉require_once('MapsEngine.php')行?是的。它正在加载自动加载器。我已经通过调用自动加载程序中的类名来验证了这一点。