Php Drupal 6位置模块使用邮政编码获取城市名称
我正在使用位置模块和启用的位置CCK字段。在创建内容时,我只是收集邮政编码和国家。我想使用与节点关联的邮政编码显示城市名称 我知道位置模块带有邮政编码数据库。是否需要查询此邮政编码数据库以获取城市名称?如果该邮政编码不可用,那么解决方案是什么Php Drupal 6位置模块使用邮政编码获取城市名称,php,drupal-6,drupal-views,drupal-modules,Php,Drupal 6,Drupal Views,Drupal Modules,我正在使用位置模块和启用的位置CCK字段。在创建内容时,我只是收集邮政编码和国家。我想使用与节点关联的邮政编码显示城市名称 我知道位置模块带有邮政编码数据库。是否需要查询此邮政编码数据库以获取城市名称?如果该邮政编码不可用,那么解决方案是什么 请指导我如何做到这一点?部分问题已经解决。这可能对其他人有所帮助。 您可以通过位置模块中提供的功能获取邮政编码信息,即。 位置\u获取\u后代码\u数据接受位置参数作为数组 @param $location * Array. the location
请指导我如何做到这一点?部分问题已经解决。这可能对其他人有所帮助。 您可以通过位置模块中提供的功能获取邮政编码信息,即。 位置\u获取\u后代码\u数据接受位置参数作为数组
@param $location
* Array. the location data
* -> the values are:
* 'street' => the string representing the street location (REQUIRED)
* 'additional' => the string representing the additional street location portion in the location form
* 'city' => the city name (REQUIRED)
* 'province' => the province code defined in the country-specific include file
* 'country' => the lower-case of the two-letter ISO code (REQUIRED)
* 'postal_code' => the postal-code (REQUIRED)
此外,我还对受支持目录中特定于国家的.inc文件进行了一些修改,以获取额外信息以及默认的lat-lon信息
但若邮政编码在数据库中不可用,则第二部分将挂起。公共功能
public function
{
$null='';
# REFERENCE SITE URL = http://developer.yahoo.com/maps/rest/V1/geocode.html
# get and output "<Result>" elements
$result=$xmlDoc->getElementsByTagName('Result');
foreach ($result as $val)
{
return $null;
}
}
{
$null='';
#参考网站URL=http://developer.yahoo.com/maps/rest/V1/geocode.html
#获取并输出“”元素
$result=$xmlDoc->getElementsByTagName('result');
foreach(结果为$val)
{
返回$null;
}
}
这是一个没有任何解决方案的旧线程: