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


C# Maps.GoogleMap类代码示例

本文整理汇总了C#中Android.Gms.Maps.GoogleMap的典型用法代码示例。如果您正苦于以下问题:C# GoogleMap类的具体用法?C# GoogleMap怎么用?C# GoogleMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GoogleMap类属于Android.Gms.Maps命名空间,在下文中一共展示了GoogleMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MapRoute

        public MapRoute(GoogleMap map, List<Station> stations)
        {
            _map = map;
            _mapRoutes = new List<Polyline>();
            _mapStations = new List<Marker>();

            // Choose color;
            Color color = Color.DodgerBlue;

            // Create polyline.
            var polyline = new PolylineOptions();
            polyline.InvokeWidth(4f);
            polyline.InvokeColor(color);

            for (var i = 0; i < stations.Count; i++)
            {
                // Add points to polyline.
                var station = stations[i];
                if (station != null && station.latitude != 0f && station.longitude != 0f)
                {
                    var latlng = new Android.Gms.Maps.Model.LatLng(station.latitude, station.longitude);
                    polyline.Add(latlng);
                    // Create marker.
                    var marker = new MarkerOptions();
                    marker.SetPosition(latlng);
                    marker.SetTitle((i + 1) + ". " + station.postName);
                    marker.Draggable(false);
                    marker.SetSnippet("ul. " + station.street);
                    _mapStations.Add(_map.AddMarker(marker));
                }
            }

            // Add polyline to map.
            _mapRoutes.Add(_map.AddPolyline(polyline));
        }
开发者ID:Lichwa,项目名称:JakDojadeXamarin,代码行数:35,代码来源:MapRoute.cs

示例2: OnMapReady

        public void OnMapReady(GoogleMap googleMap)
        {
            _map = googleMap;

            if (_map != null)
                _map.MapClick += googleMap_MapClick;
        }
开发者ID:HeikkiDev,项目名称:Mapas_XamarinForms,代码行数:7,代码来源:MyMapRenderer.cs

示例3: OnMapReady

 /* End ILocationListener interfaces */
 /// <summary>
 /// IOnMapReadyCallback interface
 /// </summary>
 /// <param name="map">Map.</param>
 public void OnMapReady(GoogleMap map)
 {
     Log.Info ("Map", "ready");
     this.map = map;
     if (lastKnownLocation != null && !ready)
         ReadyForLocationMap ();
 }
开发者ID:Sprunth,项目名称:GoFindIt,代码行数:12,代码来源:MapActivity.cs

示例4: 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

示例5: OnMapReady

 public void OnMapReady(GoogleMap googleMap)
 {
     map = googleMap;
     map.UiSettings.MyLocationButtonEnabled = false;
     map.UiSettings.ZoomControlsEnabled = false;
     CreateMarker();
 }
开发者ID:nodoid,项目名称:CustomMapping,代码行数:7,代码来源:CustomRenderer.cs

示例6: OnResume

		protected override void OnResume ()
		{
			base.OnResume ();

			// Get a handle on the map element
			_mapFragment = FragmentManager.FindFragmentById(Resource.Id.map) as MapFragment;
			_map = _mapFragment.Map;

			// Set the map type 
			_map.MapType = GoogleMap.MapTypeNormal;

			// show user location
			_map.MyLocationEnabled = true;

			// setup a location manager
			_locationManager = GetSystemService(Context.LocationService) as LocationManager;

			// Add points on the map
			MarkerOptions marker1 = new MarkerOptions()
				.SetPosition(Location_Xamarin)
				.SetTitle("Xamarin")
				.InvokeIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueBlue));
			_map.AddMarker(marker1);

			MarkerOptions marker2 = new MarkerOptions()
			    .SetPosition(Location_Atlanta)
			    .SetTitle("Atlanta, GA")
			    .InvokeIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueRed));
			_map.AddMarker(marker2);

			// Add custom marker images on the map
			AddMonkeyMarkersToMap();

			// Add custom arrow callout on map
			AddInitialNewYorkBarToMap();

			// Add custom overlay image on the map
			PositionChicagoGroundOverlay(Location_Chicago);

			// use a generic location provider instead
			Criteria locationCriteria = new Criteria();
			locationCriteria.Accuracy = Accuracy.Coarse;
			locationCriteria.PowerRequirement = Power.Medium;

			var locationProvider = _locationManager.GetBestProvider(locationCriteria, true);
			if (locationProvider != null)
			{
				_locationManager.RequestLocationUpdates(locationProvider, 2000, 1, this);
			} else
			{
				Log.Info("error", "Best provider is not available. Does the device have location services enabled?");
			}

			// TODO: Step 4a - attach map handler for marker touch
//            _map.MarkerClick += MapOnMarkerClick;

			// TODO: Step 4c - attach map handler for info window touch
//			_map.InfoWindowClick += HandleInfoWindowClick;
		}
开发者ID:flolovebit,项目名称:xamarin-evolve-2014,代码行数:59,代码来源:MainActivity.cs

示例7: OnMapReady

        public void OnMapReady (GoogleMap googleMap)
        {
            map = googleMap;

            map.UiSettings.ZoomControlsEnabled = false;

            map.MoveCamera (CameraUpdateFactory.NewLatLngZoom (new LatLng (-33.87365, 151.20689), 10));
        }
开发者ID:ravensorb,项目名称:AdMobBuddy,代码行数:8,代码来源:CameraDemoActivity.cs

示例8: OnMapReady

 public void OnMapReady (GoogleMap googleMap)
 {
     map = googleMap;
     updateTraffic ();
     updateMyLocation ();
     updateBuildings ();
     updateIndoor ();
 }
开发者ID:FirstClickStart,项目名称:yesterdaysMuffins,代码行数:8,代码来源:LayersDemoActivity.cs

示例9: OnMapReady

        public void OnMapReady(GoogleMap googleMap)
        {
            this.googleMap = googleMap;

            LatLng denmarkLatLng = new LatLng(56, 10.5);
            googleMap.MoveCamera(CameraUpdateFactory.NewLatLng(denmarkLatLng));
            googleMap.AnimateCamera(CameraUpdateFactory.ZoomTo(6));
        }
开发者ID:wijen1,项目名称:HowlOut,代码行数:8,代码来源:LocationDialog.cs

示例10: OnMapReady

        public void OnMapReady(GoogleMap googleMap)
        {
            Map = googleMap;

            var handler = MapReady;

            if (handler != null)
                handler (this, EventArgs.Empty);
        }
开发者ID:znajdzWC,项目名称:znajdz-wc-android,代码行数:9,代码来源:OnMapReadyClass.cs

示例11: OnMapReady

		public void OnMapReady (GoogleMap map)
		{
			googleMap = map;
			googleMap.UiSettings.CompassEnabled = false;
			googleMap.UiSettings.MyLocationButtonEnabled = false;
			googleMap.UiSettings.MapToolbarEnabled = false;

			UpdateLocations ();
		}
开发者ID:tranuydu,项目名称:prebuilt-apps,代码行数:9,代码来源:MapViewActivity.cs

示例12: OnMapReady

		public void OnMapReady(GoogleMap googleMap)
		{
//			googleMap.MyLocationEnabled = true;
			googleMap.UiSettings.ZoomControlsEnabled = false;
			googleMap.UiSettings.MyLocationButtonEnabled = false;
			googleMap.UiSettings.ScrollGesturesEnabled = true;
			googleMap.UiSettings.ZoomGesturesEnabled = true;
			googleMap.UiSettings.CompassEnabled = true;
			googleMap.UiSettings.MapToolbarEnabled = false;
		}
开发者ID:Surfoo,项目名称:WF.Player,代码行数:10,代码来源:ExtendedMapRenderer.cs

示例13: OnMapReady

        public void OnMapReady(GoogleMap googleMap)
        {
            this.googleMap = googleMap;

            this.googleMap.UiSettings.CompassEnabled = false;
            this.googleMap.UiSettings.MyLocationButtonEnabled = false;
            this.googleMap.UiSettings.MapToolbarEnabled = false;

            MapsInitializer.Initialize (this.Context);

            this.MoveToRegion (((LiteMap)this.Element).VisibleRegion, false);
        }
开发者ID:harrysaggu,项目名称:xamarin-plugins,代码行数:12,代码来源:LiteMapRenderer.cs

示例14: OnMapReady

		public void OnMapReady (GoogleMap googleMap)
		{
			map = googleMap;

			var circleOptions = new CircleOptions ();
			circleOptions.InvokeCenter (new LatLng (circle.Position.Latitude, circle.Position.Longitude));
			circleOptions.InvokeRadius (circle.Radius);
			circleOptions.InvokeFillColor (0X66FF0000);
			circleOptions.InvokeStrokeColor (0X66FF0000);
			circleOptions.InvokeStrokeWidth (0);
			map.AddCircle (circleOptions);
		}
开发者ID:eduardoguilarducci,项目名称:recipes,代码行数:12,代码来源:CustomMapRenderer.cs

示例15: OnMapReady

 public void OnMapReady (GoogleMap googleMap)
 {
     googleMap.MarkerDragEnd += (sender, e) => {
         mStreetViewPanorama.SetPosition (e.Marker.Position, 150);
     };
                         
     // Creates a draggable marker. Long press to drag.
     mMarker = googleMap.AddMarker (new MarkerOptions()
         .SetPosition (markerPosition)
         .SetIcon (BitmapDescriptorFactory.FromResource (Resource.Drawable.pegman))
         .Draggable(true));
 }
开发者ID:FirstClickStart,项目名称:yesterdaysMuffins,代码行数:12,代码来源:SplitStreetViewPanoramaAndMapDemoActivity.cs


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