本文整理汇总了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;
}
示例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.");
}