自定义Google地图参数删除迷你菜单

时间:2013-04-30 13:42:05

标签: html google-maps

http://mtavares.geantduweb.ca/en/annonce?view=fiche&task=fiche.display&fiche_id=5

我到处都看了......我怎么关掉了 迷你地图上的地图/星期六/地球/地球菜单...我的用户可以点击“扩展地图”并获取所有选项。但在小版本中没有任何空间......任何人都有任何想法吗?

这是我的链接生成器(用于PHP中的joomla 2.5):

function getGoogleMapData($data='') {
    if (!is_array($data)) {
        $data = array();
        $data['addr']           =   $this->_data->addr;
        $data['ville']      =   $this->_data->city;
        $data['province']   =   $this->_data->province;
        $data['postal'] =   $this->_data->postal;
    }

    //Build the address into a string based on the data we have
    $gm = array();
    $gm['addr']  = '';
    $gm['addr'] .= ($data['addr']!='') ? $data['addr'] : '';
    $gm['addr'] .= (($gm['addr']!='') && ($data['city']!='')) ? ',' : '';
    $gm['addr'] .= ($data['city']!='') ? $data['city'] : '';
    $gm['addr'] .= (($gm['addr']!='') && ($data['province']!='')) ? ',' : '';
    $gm['addr'] .= ($data['province']!='') ? $data['province'] : '';
    $gm['addr'] .= (($gm['addr']!='') && ($data['postal']!='')) ? ',' : '';
    $gm['addr'] .= ($data['postal']!='') ? $data['postal'] : '';
    $gm['param'] = ($gm['addr']!='') ? urlencode($gm['addr']) : '';

    //Use new address string and make URL to google map and a SRC URL for inside iframe (embed)
    if ($gm['param']!='') {
        //Popup window : &iwloc=A
        //&sll=45.488370,-73.463742
        if (JFactory::getLanguage()->getTag()=='en-GB') {
            $lang='en';
        } else if (JFactory::getLanguage()->getTag()=='es-ES') {
            $lang='es';
        } else {
            $lang='fr';
        }

        $gm['embed']    = sprintf('https://maps.google.ca/maps?q=%s&hl='.$lang.'&ie=UTF8&hq=&hnear=%s&t=m&z=14&output=embed', $gm['param'], $gm['param']);
        $gm['url']      = sprintf('https://maps.google.ca/maps?q=%s&hl='.$lang.'&ie=UTF8&hq=&hnear=%s&t=m&z=14&source=embed', $gm['param'], $gm['param']);

        if (JFactory::getApplication()->getName()!='site') {
            //Remove adresse popup in iframe if back-end. window too small
            $gm['embed']    = str_replace('iwloc=A&', 'iwloc=&', $gm['embed']);
            $gm['url']      = str_replace('iwloc=A&', 'iwloc=&', $gm['url']);
        }
    }

    return $gm;
} //End of makeGoogleMap()

我试过这个链接,但没有帮助...... http://www.seomoz.org/ugc/everything-you-never-wanted-to-know-about-google-maps-parameters

此部分删除了白色弹出窗口...但是如何防止单击标记并打开... id会更改单击以便打开放大版本或其他内容。

    if (JFactory::getApplication()->getName()!='site') {
        //Remove adresse popup in iframe if back-end. window too small
        $gm['embed']    = str_replace('iwloc=A&', 'iwloc=&', $gm['embed']);
        $gm['url']      = str_replace('iwloc=A&', 'iwloc=&', $gm['url']);
    }

1 个答案:

答案 0 :(得分:0)

猜猜它不可行。

我的工作......是为了让谷歌地图更大,并把它放在一个较小的div里面,以负边距居中并使用溢出:隐藏隐藏菜单......

如果我有更多的空间,我会离开菜单和谷歌徽标,但空间太小......

有点儿在底部隐藏谷歌徽标感觉很糟糕...会留下它...但它是我发现中心标记在盒子中心的唯一方法......