如何在javascript中引用其他对象的属性?

时间:2012-03-16 20:16:24

标签: javascript

参考:http://code.google.com/p/google-maps-utility-library-v3/source/browse/trunk/markerclusterer/src/markerclusterer.js?r=110

我想使用上面库中817行的ClusterIcon类中MarkerCluster类的markers_数组内容。

我该怎么做?

2 个答案:

答案 0 :(得分:0)

你不能将它原型化以暴露它吗?

MarkerClusterer.prototype.GetMarkers = function() { return this.markers_; }

答案 1 :(得分:0)

this.cluster_.markers_[0]

群集有一个标记数组的副本。