Maps v2 プロジェクトに clusterkraf をインポートしました。latlng ポイントを追加するにはどうすればよいですか?
このコードを追加しましたが、10 lat lng points を追加する方法がわかりません。
以下のコード以外のアプローチは実際には見つかりませんでした。
前もって感謝します。
public class YourMapPointModel {
public LatLng latLng;
public YourMapPointModel(LatLng latLng) {
this.latLng = latLng;
}
// encapsulation omitted for brevity
}
public class YourActivity extends FragmentActivity {
YourMapPointModel[] yourMapPointModels = new YourMapPointModel[] { new YourMapPointModel(new LatLng(0d, 1d) /* etc */ ) };
ArrayList<InputPoint> inputPoints;
private void buildInputPoints() {
this.inputPoints = new ArrayList<InputPoint>(yourMapPointModels.length);
for (YourMapPointModel model : this.yourMapPointModels) {
this.inputPoints.add(new InputPoint(model.latLng, model));
}
}
Clusterkraf clusterkraf;
private void initClusterkraf() {
if (googleMap != null && this.inputPoints != null && this.inputPoints.size() > 0) {
com.twotoasters.clusterkraf.Options options = new com.twotoasters.clusterkraf.Options();
// customize the options before you construct a Clusterkraf instance
this.clusterkraf = new Clusterkraf(googleMap, options, this.inputPoints);
}
}
}