当前位置: 首页>>代码示例>>C#>>正文


C# GoogleMap.Clear方法代码示例

本文整理汇总了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));
        }
开发者ID:tranuydu,项目名称:prebuilt-apps,代码行数:28,代码来源:MapFragmentActivity.cs

示例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);
                }
            }
        }
开发者ID:MbProg,项目名称:TestApolloAndroid,代码行数:61,代码来源:State.cs


注:本文中的Android.Gms.Maps.GoogleMap.Clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。