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


C# GoogleMap.AddGroundOverlay方法代码示例

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


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

示例1: OnElementChanged

        protected override void OnElementChanged(Xamarin.Forms.Platform.Android.ElementChangedEventArgs<Xamarin.Forms.View> e)
        {
            base.OnElementChanged(e);

            extendedMap = (ExtendedMap)Element;
            mapView = Control as MapView;
            map = mapView.Map;

            map.MarkerClick+= HandleMarkerClick;

            // Pin tıklanınca sağalta açılan menüyü engellemek için
            map.UiSettings.MapToolbarEnabled = true;
            map.UiSettings.MyLocationButtonEnabled = true;

            if (extendedMap.isOverlayNeeded) {
                LatLng southwest = new LatLng (extendedMap.sw.Latitude, extendedMap.sw.Longitude);
                LatLng northeast = new LatLng (extendedMap.ne.Latitude, extendedMap.ne.Longitude);

                LatLngBounds bounds = new LatLngBounds (southwest, northeast);

                string url = extendedMap.overlayURL;//"http://www.mgm.gov.tr/mobile/mblhrt/data/radar/MAX--_6100_P00.png";

                Bitmap objBitmap = GetImageBitmapFromUrl (url);

                BitmapDescriptor objBitmapDescriptor = BitmapDescriptorFactory.FromBitmap (objBitmap);
                GroundOverlayOptions objGroundOverlayOptions = new GroundOverlayOptions ().PositionFromBounds (bounds)/*.Position (objMapPosition, 100000)*/.InvokeImage (objBitmapDescriptor);

                map.AddGroundOverlay (objGroundOverlayOptions);

                //For freeing memory
                objBitmap.Recycle ();
            }

            for (int i = 0; i < extendedMap.pinDatas.Count; i++) {
                var markerWithIcon = new MarkerOptions ();
                markerWithIcon.SetPosition (new LatLng (extendedMap.pinDatas[i].lat, extendedMap.pinDatas[i].lng));
                markerWithIcon.SetTitle (i.ToString());
                /*markerWithIcon.SetTitle ("aa");
                markerWithIcon.SetSnippet ("bb");*/
                int resID = Resources.GetIdentifier (extendedMap.pinDatas [i].icon, "drawable" , "com.app1001.bluemart");
                //System.Diagnostics.Debug.WriteLine (resID);
                markerWithIcon.SetIcon(BitmapDescriptorFactory.FromResource(resID));
                map.AddMarker (markerWithIcon);
            }

            //Add Pins

            //map.SetInfoWindowAdapter(this);
            map.UiSettings.RotateGesturesEnabled = false;
        }
开发者ID:jiletx,项目名称:Bluemart,代码行数:50,代码来源:ExtendedMapRenderer.cs

示例2: OnMapReady

        public void OnMapReady (GoogleMap googleMap)
        {
            googleMap.MoveCamera (CameraUpdateFactory.NewLatLngZoom (NEWARK, 11));

            images.Clear ();
            images.Add (BitmapDescriptorFactory.FromResource (Resource.Drawable.newark_nj_1922));
            images.Add (BitmapDescriptorFactory.FromResource (Resource.Drawable.newark_prudential_sunny));

            currentEntry = 0;

            groundOverlay = googleMap.AddGroundOverlay (new GroundOverlayOptions ()
                .InvokeImage (images [currentEntry])
                .Anchor (0, 1)
                .Position (NEWARK, 8600f, 6500f));

            transparencyBar.ProgressChanged += (sender, e) => {
                if (groundOverlay != null)
                    groundOverlay.Transparency = (float)e.Progress / (float)TRANSPARENCY_MAX;                    
            };

            googleMap.SetContentDescription ("Google Map with ground overlay.");
        }
开发者ID:ravensorb,项目名称:AdMobBuddy,代码行数:22,代码来源:GroundOverlayDemoActivity.cs


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