本文整理汇总了C#中MapView.SetBuiltInZoomControls方法的典型用法代码示例。如果您正苦于以下问题:C# MapView.SetBuiltInZoomControls方法的具体用法?C# MapView.SetBuiltInZoomControls怎么用?C# MapView.SetBuiltInZoomControls使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapView
的用法示例。
在下文中一共展示了MapView.SetBuiltInZoomControls方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
/*
* For Information on how to add you own keystore to the project read the README from the
* old GoogleMaps sample: https://github.com/xamarin/monodroid-samples/tree/master/GoogleMaps
*
* */
// Remember to generate your own API key
mapView = new MapView(this, "0Nd7w_yOI1NbUsBP_Mg2IosWa0Ns2j22r4meJnA");
mapView.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);
SetContentView(mapView);
mapView.SetBuiltInZoomControls(true);
mapView.Enabled = true;
mapView.Clickable = true; //This has to be set to true to be able to navigate the map
myLocationOverlay = new MyLocationOverlay(this, mapView); //this shows your current position on the map
mapView.Overlays.Add(myLocationOverlay);
Drawable marker = Resources.GetDrawable(Resource.Drawable.Icon); //these are the markers put on the map
myItemizedOverlay = new MyItemizedOverlay(this, marker);
mapView.Overlays.Add(myItemizedOverlay);
myItemizedOverlay.AddItem(new GeoPoint((int)(55.816149 * 1E6),(int)(12.532868 * 1E6)), "BKSV", "Brüel & Kjær Sound & Vision");
mapView.PostInvalidate();
}
示例2: OnCreate
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.MapFragmentLayout);
mapView = FindViewById<MapView> (Resource.Id.fragmentMapView);
myLocation = new MyLocationOverlay (this, mapView);
myLocation.RunOnFirstFix (() => {
//mapView.Controller.AnimateTo (myLocation.MyLocation);
var maxLat = Math.Max (myLocation.MyLocation.LatitudeE6, assignment.Latitude.ToIntE6 ());
var minLat = Math.Min (myLocation.MyLocation.LatitudeE6, assignment.Latitude.ToIntE6 ());
var maxLong = Math.Max (myLocation.MyLocation.LongitudeE6, assignment.Longitude.ToIntE6 ());
var minLong = Math.Min (myLocation.MyLocation.LongitudeE6, assignment.Longitude.ToIntE6 ());
mapView.Controller.ZoomToSpan (Math.Abs (maxLat - minLat), Math.Abs (maxLong - minLong));
mapView.Controller.AnimateTo (new GeoPoint ((maxLat + minLat) / 2, (maxLong + minLong) / 2));
});
mapView.Overlays.Add (myLocation);
mapView.Controller.SetZoom (5);
mapView.Clickable = true;
mapView.Enabled = true;
mapView.SetBuiltInZoomControls (true);
}
示例3: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.MapView);
map = FindViewById<MapView>(Resource.Id.Map);
map.Clickable = true;
map.Traffic = false;
map.Satellite = true;
map.SetBuiltInZoomControls(true);
map.Controller.SetZoom(17);
map.Controller.SetCenter(new GeoPoint((int)(29.97611 * 1e6), (int)(31.132778 * 1e6))); // Pyramids of Giza
AddPinOverlay(map);
}
示例4: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.MapView);
map = FindViewById<MapView>(Resource.Id.Map);
map.Clickable = true;
map.Traffic = false;
map.Satellite = true;
map.SetBuiltInZoomControls(true);
map.Controller.SetZoom(15);
map.Controller.SetCenter(new GeoPoint((int)(48.857 * 1e6), (int)(2.351 * 1e6))); // Paris
AddMyLocationOverlay(map);
}
示例5: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.MapView);
map = FindViewById<MapView>(Resource.Id.Map);
map.Clickable = true;
map.Traffic = false;
map.Satellite = true;
map.SetBuiltInZoomControls(true);
map.Controller.SetZoom(15);
map.Controller.SetCenter(new GeoPoint((int)(34.120 * 1e6), (int)(-118.188 * 1e6))); // Los Angeles
AddPinOverlay(map);
}
示例6: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Map);
_map = FindViewById<MapView>(Resource.Id.Map);
_map.SetBuiltInZoomControls(true);
var newYorkCity = new GeoPoint((int) (40.716667 * 1e6), (int) (-74 * 1e6));
_map.Controller.SetCenter(newYorkCity);
_map.Controller.SetZoom(14);
_mapOverlay = new MapOverlay(Resources.GetDrawable(Resource.Drawable.Icon), this);
_map.Overlays.Add(_mapOverlay);
_mapOverlay.Add(newYorkCity, "New York City");
_locationManager = (LocationManager)GetSystemService(LocationService);
}
示例7: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.main);
_mapView = FindViewById<MapView>(Resource.Id.mapview);
_mapView.SetBuiltInZoomControls(true);
// First overlay
_drawable1 = Resources.GetDrawable(Resource.Drawable.marker);
_itemizedOverlay = new SimpleItemizedOverlay(_drawable1, _mapView);
var point = new GeoPoint((int)(51.5174723 * 1E6), (int)(-0.0899537 * 1E6));
var overlayItem = new OverlayItem(point, "Tomorrow Never Dies (1997)", "(M gives Bond his mission in Daimler car)");
_itemizedOverlay.AddOverlay(overlayItem);
var point2 = new GeoPoint((int)(51.515259 * 1E6), (int)(-0.086623 * 1E6));
var overlayItem2 = new OverlayItem(point2, "GoldenEye (1995)", "(Interiors Russian defence ministry council chambers in St Petersburg)");
_itemizedOverlay.AddOverlay(overlayItem2);
_mapView.Overlays.Add(_itemizedOverlay);
// second overlay
_drawable2 = Resources.GetDrawable(Resource.Drawable.marker2);
_itemizedOverlay2 = new SimpleItemizedOverlay(_drawable2, _mapView);
var point3 = new GeoPoint((int)(51.513329 * 1E6), (int)(-0.08896 * 1E6));
var overlayItem3 = new OverlayItem(point3, "Sliding Doors (1998)", null);
_itemizedOverlay2.AddOverlay(overlayItem3);
var point4 = new GeoPoint((int)(51.51738 * 1E6), (int)(-0.08186 * 1E6));
var overlayItem4 = new OverlayItem(point4, "Mission: Impossible (1996)", "(Ethan & Jim cafe meeting)");
_itemizedOverlay2.AddOverlay(overlayItem4);
_mapView.Overlays.Add(_itemizedOverlay2);
if (bundle == null)
{
var mc = _mapView.Controller;
mc.SetZoom(16);
mc.AnimateTo(point2);
}
}
示例8: SetupMap
private void SetupMap(MapView map, Point center, int zoomLevel)
{
map.Controller.SetZoom(zoomLevel);
map.Controller.SetCenter(new GeoPoint(center.Y, center.X));
map.SetBuiltInZoomControls(true);
_annotationView = new AnnotationView(map);
}
示例9: OnCreate
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
// Create your application here
SetContentView (Resource.Layout.MapViewLayout);
assignmentMapViewLayout = FindViewById<LinearLayout> (Resource.Id.mapViewAssignmentLayout);
assignmentMapViewLayout.Click += (sender, e) => {
var intent = new Intent (this, typeof (SummaryActivity));
var tabActivity = (AssignmentTabActivity)Parent;
tabActivity.MapData = null;
assignmentViewModel.SelectedAssignment = assignmentViewModel.ActiveAssignment;
menuViewModel.MenuIndex = Constants.Navigation.IndexOf ("Map");
StartActivity (intent);
};
mapView = FindViewById<MapView> (Resource.Id.googleMapsView);
myLocation = new MyLocationOverlay (this, mapView);
mapView.Overlays.Add (myLocation);
mapView.Clickable = true;
mapView.Enabled = true;
mapView.SetBuiltInZoomControls (true);
//View containing the active assignment
var view = new View (this);
LayoutInflater inflator = (LayoutInflater)GetSystemService (Context.LayoutInflaterService);
view = inflator.Inflate (Resource.Layout.AssignmentItemLayout, null);
assignmentMapViewLayout.AddView (view);
view.LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent);
view.SetBackgroundDrawable (Resources.GetDrawable (Resource.Drawable.active_assignment_selector));
number = view.FindViewById<TextView> (Resource.Id.assignmentItemNumber);
job = view.FindViewById<TextView> (Resource.Id.assignmentJob);
name = view.FindViewById<TextView> (Resource.Id.assignmentName);
phone = view.FindViewById<TextView> (Resource.Id.assignmentPhone);
address = view.FindViewById<TextView> (Resource.Id.assignmentAddress);
buttonLayout = view.FindViewById<LinearLayout> (Resource.Id.assignmentButtonLayout);
timerLayout = view.FindViewById<LinearLayout> (Resource.Id.assignmentTimerLayout);
activeSpinner = view.FindViewById<Spinner> (Resource.Id.assignmentStatus);
spinnerImage = view.FindViewById<ImageView> (Resource.Id.assignmentStatusImage);
timer = view.FindViewById<ToggleButton> (Resource.Id.assignmentTimer);
timerText = view.FindViewById<TextView> (Resource.Id.assignmentTimerText);
phoneButton = view.FindViewById<RelativeLayout> (Resource.Id.assignmentPhoneLayout);
mapButton = view.FindViewById<RelativeLayout> (Resource.Id.assignmentAddressLayout);
phoneButton.Click += (sender, e) => {
Extensions.MakePhoneCall (this, phone.Text);
};
mapButton.Click += (sender, e) => {
var intent = new Intent (this, typeof (SummaryActivity));
var tabActivity =(AssignmentTabActivity)Parent;
tabActivity.MapData = null;
assignmentViewModel.SelectedAssignment = assignmentViewModel.ActiveAssignment;
menuViewModel.MenuIndex = 0;
StartActivity (intent);
};
assignmentViewModel.LoadTimerEntryAsync ().ContinueWith (_ => {
RunOnUiThread (() => {
if (assignmentViewModel.Recording) {
timer.Checked = true;
} else {
timer.Checked = false;
}
});
});
timer.CheckedChange += (sender, e) => {
if (e.IsChecked != assignmentViewModel.Recording) {
if (assignmentViewModel.Recording) {
assignmentViewModel.PauseAsync ();
} else {
assignmentViewModel.RecordAsync ();
}
}
};
activeSpinner.ItemSelected += (sender, e) => {
if (assignment != null) {
var selected = assignmentViewModel.AvailableStatuses.ElementAtOrDefault (e.Position);
if (selected != assignment.Status) {
switch (selected) {
case AssignmentStatus.Hold:
assignment.Status = selected;
assignmentViewModel.SaveAssignmentAsync (assignment).ContinueWith (_ => {
RunOnUiThread (() => {
SetAssignment (false);
mapView.Overlays.Clear ();
mapView.Overlays.Add (myLocation);
UpdateLocations ();
});
});
break;
case AssignmentStatus.Complete:
//go to confirmations
var intent = new Intent (this, typeof (SummaryActivity));
menuViewModel.MenuIndex = Constants.Navigation.IndexOf (Constants.Confirmations);
//.........这里部分代码省略.........
示例10: InitializeMapView
private void InitializeMapView()
{
var apiKey = this.GetGoogleMapsApiKey();
_map = new MapView(Activity, apiKey)
{
Clickable = true
};
_map.Controller.SetZoom(17);
_map.SetBuiltInZoomControls(true);
_map.DisplayZoomControls(true);
}