本文整理汇总了Java中com.google.android.gms.maps.GoogleMap.clear方法的典型用法代码示例。如果您正苦于以下问题:Java GoogleMap.clear方法的具体用法?Java GoogleMap.clear怎么用?Java GoogleMap.clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.maps.GoogleMap
的用法示例。
在下文中一共展示了GoogleMap.clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMapReady
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
/**
* Manipulates the map once available.
* This callback is triggered when the map is ready to be used.
* This is where we can add markers or lines, add listeners or move the camera. In this case,
* we just add a marker near Sydney, Australia.
* If Google Play services is not installed on the device, the user will be prompted to install
* it inside the SupportMapFragment. This method will only be triggered once the user has
* installed Google Play services and returned to the app.
*/
@Override
public void onMapReady(GoogleMap googleMap) {
googleMap.clear();
GoToMap = googleMap;
Intent i = getIntent();
ArrayList<LatLng> list1 = i.getParcelableArrayListExtra("key1");
ArrayList<String> list2 = i.getStringArrayListExtra("key2");
ArrayList<String> list3 = i.getStringArrayListExtra("key3");
LatLng latLng = new LatLng(0, 0);
int j = list1.size();
j=j-1;
while (j!=-1)
{
if(list1.get(j)!=latLng)
{ Log.i(list1.get(j).toString(),list1.get(j).toString());
GoToMap.addMarker(new MarkerOptions().position(list1.get(j)).draggable(true).title(list3.get(j).replace(',','.')+" Battery Power "+list2.get(j)));
GoToMap.moveCamera(CameraUpdateFactory.newLatLng(list1.get(j)));
}
j--;
}
// Add a marker in Sydney and move the camera
}
示例2: setMarkers
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
private void setMarkers(GoogleMap map, List<Restaurant> restaurants) {
if (map == null) {
return;
}
map.clear();
MarkerOptions options = new MarkerOptions().position(
new LatLng(Prefs.LastLatitude.getDouble(), Prefs.LastLongitude.getDouble()))
.icon(BitmapDescriptorFactory.fromResource(R.drawable.current_location));
map.addMarker(options);
for (Restaurant restaurant : restaurants) {
MarkerOptions markerOptions = new MarkerOptions().position(
new LatLng(restaurant.mLatitude, restaurant.mLongitude))
.title(restaurant.mName)
.icon(BitmapDescriptorFactory.fromResource(R.drawable.restaurant_pin));
Marker marker = map.addMarker(markerOptions);
marker.setTag(restaurant);
}
mMap.setOnInfoWindowClickListener(mInfoWindowClickListener);
}
示例3: refreshMap
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
private void refreshMap(GoogleMap mapInstance){
mapInstance.clear();
}