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

问题描述 投票:0回答:1

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']);
    }
php html google-maps joomla
1个回答
0
投票

我猜这是不可行的。

我的工作......是让谷歌地图更大,并将其放在一个较小的div内,以负边距居中,并使用溢出:隐藏来隐藏菜单......

如果我有更多空间,我会保留菜单和谷歌徽标,但空间太小了......

将谷歌徽标隐藏在底部有点感觉不好...会把它留在那里...但这是我发现中心标记在框中居中的唯一方法...

© www.soinside.com 2019 - 2024. All rights reserved.