Luk*_*asz 1 location drupal map
我正在使用gmap和位置模块来支持我的内容类型的位置.我已经配置了这些模块(Map API密钥等等),所以当我编辑/添加新节点时,我会通过鼠标指向选择/设置lattitude jus.我也可以把地址等等.但是当我查看我的节点地图时没有显示出来.我只能看到地址字段.
为什么会这么混乱?
我在admin/content/types设置页面中检查了显示字段设置,并且所有字段都设置为可见.我在这里错过了什么?为什么地图不像节点编辑页面那样简单可见?
标准主题不包括实际地图,但它很容易做到.您需要用来创建地图的是gmap_simple_map功能.我过去在location.tpl.php中做过这个,因为我通常想要覆盖那些东西.所以我在其底部添加了这样的内容以包含地图:
<?php
// "Geo" microformat, see http://microformats.org/wiki/geo
if ($latitude && $longitude) {
// Assume that 0, 0 is invalid.
if ($latitude != 0 || $longitude != 0) {
$marker = 'Whatever you want the marker to be.';
print gmap_simple_map($latitude, $longitude, '', $marker, 'default');
}
}
?>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8100 次 |
| 最近记录: |