私は を使用しており、現在この例 (アニメーション クラスター戦略)gwt-openlayers-1.0
を学習しています。
私のプロジェクトでは、それぞれVectoreFeature
に数値ラベルがあり、各クラスター ポイントの基になるポイントのラベル値の合計を表示したいと考えています。それを行う方法はありますか?
upd: JS のこの
記事 (「最も重要な」戦略の部分) に
よると、次のようになります。
// for each feature:
feature.attributes = { result_count: 10 };
...
var style = new OpenLayers.Style({
...
} , context: {
label: function(feature) {
if (feature.cluster) {
var result_count = 0;
for (var i = 0; i < feature.cluster.length; i++) {
result_count += feature.cluster[i].attributes.result_count;
}
features.attributes.label = result_count.toString();
} else {
features.attributes.label = features.attributes.result_count.toString();
}
}
}
しかし、gwt-openlayers でこれを実装する方法が見つかりません。
org.gwtopenmaps.openlayers.client.Style style = new org.gwtopenmaps.openlayers.client.Style();
style.setLabel( ??? );