本文整理汇总了C#中Android.Gms.Maps.GoogleMap.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# GoogleMap.Clear方法的具体用法?C# GoogleMap.Clear怎么用?C# GoogleMap.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Gms.Maps.GoogleMap
的用法示例。
在下文中一共展示了GoogleMap.Clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnMapReady
public void OnMapReady(GoogleMap map)
{
googleMap = map;
googleMap.UiSettings.CompassEnabled = false;
googleMap.UiSettings.MyLocationButtonEnabled = false;
googleMap.UiSettings.MapToolbarEnabled = false;
if (googleMap == null)
return;
googleMap.Clear ();
try {
MapsInitializer.Initialize (this);
} catch (GooglePlayServicesNotAvailableException e) {
Console.WriteLine ("Google Play Services not available:" + e);
return;
}
if (assignment == null)
return;
var markerOptions = GetMarkerOptionsForAssignment (assignment);
googleMap.AddMarker (markerOptions).ShowInfoWindow ();
googleMap.CameraPosition.Target = markerOptions.Position;
googleMap.MoveCamera (CameraUpdateFactory.NewLatLngZoom (markerOptions.Position, 15f));
}
示例2: DrawMap
async public void DrawMap()
{
if ( _stateClass._person != null)
{
_mapFragment = MapFragment.FragmentManager.FindFragmentById(Resource.Id.map) as MapFragment;
_map = _mapFragment.Map;
_map.Clear();
// Set the map type
// show user location
_map.MyLocationEnabled = true;
// setup a location manager
_locationManager = _mainActivity.GetSystemService (Context.LocationService) as LocationManager;
// use a generic location provider instead
Criteria locationCriteria = new Criteria();
locationCriteria.Accuracy = Accuracy.Coarse;
locationCriteria.PowerRequirement = Power.Medium;
await System.Threading.Tasks.Task.Delay(0);
var geoCoder = new Geocoder(_mainActivity);
try
{
Address address = this.GetAddressesFromLocation(_stateClass._person.Strasse,_stateClass._person.PLZ,_stateClass._person.Ort,_stateClass._person.Land);
MarkerOptions marker1 = new MarkerOptions();
if (address != null)
{
marker1.SetPosition(new LatLng(address.Latitude, address.Longitude));
marker1.SetTitle(_stateClass._person.Name + " - " + _stateClass._person.Strasse + " - " + _stateClass._person.Ort + "- " + _stateClass._person.Umsatz);
marker1.InvokeIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueRed));
_Marker = _map.AddMarker(marker1);
_map.AnimateCamera(CameraUpdateFactory.NewLatLngZoom(new Android.Gms.Maps.Model.LatLng(address.Latitude, address.Longitude), 9.0f));
}
else
{
Android.Widget.Toast.MakeText(_mainActivity,_mainActivity.Resources.GetString(Resource.String.AddresseNichtGefunden), Android.Widget.ToastLength.Short).Show();
}
_map.MarkerClick += (object sender, GoogleMap.MarkerClickEventArgs markerClickEventArgs) =>
{
markerClickEventArgs.Handled = true;
Marker marker = markerClickEventArgs.Marker;
_map.AnimateCamera(CameraUpdateFactory.NewLatLngZoom(marker.Position, 13));
marker.ShowInfoWindow();
};
}
catch(Exception ex)
{
DataAccessLayer.ExceptionWriter.WriteLogFile(ex);
}
}
}