0

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);
            }
        }

    }
4

2 に答える 2

1

ポイントには次のコードを使用できます。

        Position_mark = new LatLng(35.7008, 51.437);
        Marker hamburg = map.addMarker(new MarkerOptions().position(
                Position_mark).title("Hamburg"));

        Position_Now = Position_mark;
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(Position_mark,
                15));

        map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);

for(;;).....にコマンドを入れて、10ポイントを追加します

于 2013-10-30T08:45:09.380 に答える
0

Google マップ V2 でルーティング ポイントの Google 方向ライブラリをテストする

https://github.com/jd-alexander/Google-Directions-Android

于 2013-10-30T11:20:01.163 に答える