【问题标题】:Increase Google Map Info Window Size增加谷歌地图信息窗口大小
【发布时间】:2011-11-30 08:01:16
【问题描述】:

我有一个谷歌地图。

还有一个信息窗口。

现在尺寸是标准的,里面有 r 个文本。

所以,我的老板让我增加它。

我们正在使用ektron CMS,因此我需要进入ektron workarea 并编辑map.js

即使是ektron,还是用google map。

我设法找出显示为信息窗口的部分。

这是弹出信息窗口并在里面显示信息的代码部分。

marker = new GMarker(point, icon);
var infoWindow = map.getInfoWindow();
GEvent.addListener(marker, "mouseover", function () {
                    if (EMap.SearchData != 'content') {
                        if (qlink && qlink.length > 0) {
                            _userTB = '<span>' + title + '</span>';
                        }
                        else {
                            _userTB = title;
                        }
                        var theHtml1 = '<div id="IW_' + markerid + '" style="overflow:auto;width:240px;height:100px;">' + markerid + '. ' + _userTB + _summarytxt + '<br/>' + EGlobal.Format(EMap.Geolocation, new Array('javascript:EMap.SetAddress(\'' + EGlobal.Replace(address, '#', ' ') + '\',\'to\');', 'javascript:EMap.SetAddress(\'' + EGlobal.Replace(address, '#', ' ') + '\',\'from\');')) + '</div>';
                        map.openInfoWindowHtml(theHtml1);
                    }
                    else {
                        var theHtml2 = '<div id="IW_' + markerid + '" style="overflow:auto;width:240px;height:100px;">' + markerid + '. <span><b>' + title + '</b></span><br/>' + _summarytxt + '<br/>' + EGlobal.Format(EMap.Geolocation, new Array('javascript:EMap.SetAddress(\'' + EGlobal.Replace(address, '#', ' ') + '\',\'to\');', 'javascript:EMap.SetAddress(\'' + EGlobal.Replace(address, '#', ' ') + '\',\'from\');')) + '</div>';
                        marker.openInfoWindowHtml(theHtml2);
                    }
                });

我尝试在谷歌上搜索,发现这是一个人试图更改信息窗口大小的方式。

var infoWindow = map.getInfoWindow();
var point = new GLatLng(0,0);
var marker = new GMarker(point);
GEvent.bind(marker,”click”,marker,function() {
    map.openInfoWindowHtml(this.getPoint(),this.address,{onOpenFn:function(){
        infoWindow.reset(this.getPoint(),infoWindow.getTabs(),new GSize(200,200),null,null);
    }});
});

全文在this site

但我无法将它们合并为 1。

尤其是那个家伙正在使用带有 3 个参数的 map.openInfoWindowHtml(),而 ektron 正在使用只有一个参数的 marker.openInfoWindowHtml()

知道如何完成这项工作吗? Tkz 很多。

而且.. 我对谷歌地图很陌生。所以,如果我的问题浪费了你的时间,请原谅我。

【问题讨论】:

    标签: javascript google-maps google-maps-api-2 ektron openinfowindowhtml


    【解决方案1】:

    也许这个答案太简单了,但您是否已经尝试在 openInfoWindowHTML() 调用中编辑此行?

    style="overflow:auto;width:240px;height:100px;">
    

    【讨论】:

    • 是的,这就是答案。我忽略了因为..当我尝试在萤火虫中更改那条线时,只有&lt;div&gt; 变大了。但是当我换上js 时,整个信息窗口变得更大了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-10
    • 2013-05-18
    相关资源
    最近更新 更多