0
我已經在我的地圖v2項目中導入了聚光燈。現在如何添加緯度點?添加經緯度到聚光燈
我已添加此代碼,我不知道如何添加10個經緯度點。
我從來沒有真正發現任何方法,除了下面的代碼。我真的很感激任何幫助。
在此先感謝。
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);
}
}
}
其clustekraf:https://github.com/twotoaste rs/clusterkraf – jason
其不同的庫。如何使用clusterkraf? – jason