2013-10-30 37 views
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); 
      } 
     } 

    } 

回答

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

,並把coomands爲(;;).....那加10分

+0

其clustekraf:https://github.com/twotoaste rs/clusterkraf – jason

+0

其不同的庫。如何使用clusterkraf? – jason