我有个谷歌地图。
还有一个信息窗口。
现在大小是标准的,里面有大量的文本。
所以,我的老板让我增加它。
我们使用的是ektron CMS,因此我需要进入ektron workarea并编辑map.js
即使是ektron,它仍然在使用谷歌地图。
我设法找出哪个部分显示为信息窗口。
这是代码中弹出信息窗口并在其中显示信息的部分。
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()。
你知道该怎么做吗?非常感谢。
然后..。我是谷歌地图的新手。所以,如果我的问题浪费了你的时间,请原谅。
发布于 2011-11-30 18:27:08
也许这个答案太简单了,但是您是否已经尝试过在openInfoWindowHTML()调用中编辑这一行?
style="overflow:auto;width:240px;height:100px;">https://stackoverflow.com/questions/8322769
复制相似问题