Rap*_*dro 5 google-maps google-maps-api-3 markerclusterer
我试图在'clusterclick'事件中将一个infoBubble添加到markerCluster,但是infoBubble.Open方法要求绑定一个'marker'参数.问题是markerCluster不是google.maps.Point所以将infoBubble绑定到它是不可能的.
我将markerCluster的可能性分配给了infoBubble,但是infoBubble重新绘制了新位置,从而将标记从其中移开.
有没有人有同样的问题?有没有修改原始infoBubble代码的解决方案?
http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/
解决方案问题1: 标记参数是可选的如果我只是从不分配它,问题就解决了.
使用:
infoBubble.setPossition(latLng);
infoBubble.open(map);
Run Code Online (Sandbox Code Playgroud)
不:
infoBubble.open(map, marker);
Run Code Online (Sandbox Code Playgroud)
问题2:但现在infoBubble出现在市场上,有没有办法将其提升?
解决问题2:
我修改了InfoBubble sourceCode以包含offsetParameter,然后在draw函数中添加像素:
InfoBubble.prototype.PIXEL_OFFSET = 0
...
var top = pos.y - (height + arrowSize); if (anchorHeight) { top -= anchorHeight; } top -= this.PIXEL_OFFSET
Run Code Online (Sandbox Code Playgroud)
以防有人遇到同样的问题
| 归档时间: |
|
| 查看次数: |
8268 次 |
| 最近记录: |