Google maps 如何减少wicket stuff gmap3库中的信息窗口大小?

Google maps 如何减少wicket stuff gmap3库中的信息窗口大小?,google-maps,wicket,wicketstuff,Google Maps,Wicket,Wicketstuff,我写了一个页面,显示二手商品的卖家。地图上有许多简短的信息元素,包括价格、物品状态和卖家的可用期。我想减少信息窗口的可用空间,这样更多的信息窗口可以适应屏幕。我在wicket stuff gmap3的6.5.0中尝试了新功能——“信息窗口内的面板”,但运气不佳-图片显示了css的结果: border : 1px solid black ; margin : 0; padding : 0; 我如何最小化信息winfo窗口的可用空间并使其适合内容 另外,如果我能用指针制作一组可点击的数字,那将是最

我写了一个页面,显示二手商品的卖家。地图上有许多简短的信息元素,包括价格、物品状态和卖家的可用期。我想减少信息窗口的可用空间,这样更多的信息窗口可以适应屏幕。我在wicket stuff gmap3的6.5.0中尝试了新功能——“信息窗口内的面板”,但运气不佳-图片显示了css的结果:

border : 1px solid black ;
margin : 0;
padding : 0;
我如何最小化信息winfo窗口的可用空间并使其适合内容

另外,如果我能用指针制作一组可点击的数字,那将是最好的。但信息窗口不可点击,所以有标记。Idea-用户首先根据信息窗口中显示的主要属性进行孵化选择,然后单击其选择并完成页面上其他地方显示的信息

p.p.S.嗯,我现在还有一个主意-我不需要州的数字。我只是可以用不同的颜色来绘制信息(绿色=“像新的”,蓝色=“使用很难,但很有效”,红色=“垃圾”):)

又快又脏

var infowindow = new google.maps.InfoWindow({
  content: '<div id="iw_content"><a href="/" style="color:#f00">3434</a> <a href="/" style="color:#00f">4</a> <a href="/" style="color:#0f0">18-9</a></div>'
});

google.maps.event.addListener(infowindow,'domready',function(){
  var el = document.getElementById('iw_content');
  //* Get and set a class for the main content containers container
  el = el.parentNode.parentNode;
  el.setAttribute('class','iw_content_container_container');
  //* Get and set a class for the div containing the close window image
  closeEl = (el.previousElementSibling)?el.previousElementSibling:el.previousSibling;
  closeEl.setAttribute('class','closeInfoWindow');
  //* Get and set a class for the div containing the close and main content
  el = el.parentNode;
  el.setAttribute('class','closeInfoWindowContainer');
  //* Get and hide the troublesome background
  el = (el.previousElementSibling)?el.previousElementSibling:el.previousSibling;
  el.style.display = "none";
  //* Get and hide the top image of the arrow
  el = (el.previousElementSibling)?el.previousElementSibling:el.previousSibling;
  el.style.display = 'none';
  //* Get and hide the shadow (hiding commented out for now as not strictly requested)
  el = el.parentNode.parentNode;
  el = (el.previousElementSibling)?el.previousElementSibling.previousElementSibling:el.previousSibling.previousSibling;
  //el.style.display = 'none';
});
您可能想搞乱.closeInfoWindowContainer的顶部值,因为这取决于文本的数量。基本上是用你的那一行测试的

我尝试在代码本身中删除宽度和高度(因此在javascript中添加/更改),但映射有一个恼人的习惯,即根据加载时光标的状态和位置将其重新放入

信息窗口是可点击的。它们只是页面中的一个普通div元素,可以这样处理。我在您的示例中制作了各种值的超链接来显示这一点


很抱歉,这不是wicketstuff,但我想我还是应该发布一个解决方案。

非常感谢!我将尝试采用这种解决方案。
#iw_content{background:#fff}
.iw_content_container_container{height:auto!important;text-align:center}
.closeInfoWindow {top:22px!important;right:22px!important}
.closeInfoWindowContainer{position:absolute;top:52px;height:auto!important}