本文整理汇总了C#中Android.Gms.Maps.GoogleMap.MoveCamera方法的典型用法代码示例。如果您正苦于以下问题:C# GoogleMap.MoveCamera方法的具体用法?C# GoogleMap.MoveCamera怎么用?C# GoogleMap.MoveCamera使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Gms.Maps.GoogleMap
的用法示例。
在下文中一共展示了GoogleMap.MoveCamera方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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));
}
示例2: OnMapReady
public void OnMapReady (GoogleMap googleMap)
{
map = googleMap;
map.UiSettings.ZoomControlsEnabled = false;
map.MoveCamera (CameraUpdateFactory.NewLatLngZoom (new LatLng (-33.87365, 151.20689), 10));
}
示例3: OnMapReady
public void OnMapReady(GoogleMap googleMap)
{
mMap = googleMap;
LatLng latlng = new LatLng(loc.Latitude, loc.Longitude); //Wijnhaven
CameraUpdate camera = CameraUpdateFactory.NewLatLngZoom(latlng, 15);
mMap.MoveCamera(camera);
MarkerOptions start = new MarkerOptions()
.SetPosition(latlng)
.SetTitle("Uw huidige locatie")
.SetSnippet("U bevind zich hier")
.SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueBlue));
mMap.AddMarker(start);
MarkerFactory mFactory = new MarkerFactory(preLoad.csvFT.getMarkers());
float lowest = 99999;
for (Iterator iter = mFactory.getIterator(); iter.hasNext();)
{
FietsTrommel ft = iter.next();
if (ft.xcoord.Length > 0 && ft.ycoord.Length > 0)
{
double lat = Convert.ToDouble(ft.xcoord.Replace('.', ','));
double lon = Convert.ToDouble(ft.ycoord.Replace('.', ','));
Location fietsT = new Location("");
fietsT.Latitude = lat;
fietsT.Longitude = lon;
if (fietsT.DistanceTo(loc) < 500)
{
LatLng coords = new LatLng(lat, lon);
MarkerOptions newMarker = new MarkerOptions()
.SetPosition(coords)
.SetTitle(ft.Straat)
.SetSnippet("Sinds: " + ft.Mutdatum)
.Draggable(true);
mMap.AddMarker(newMarker);
}
if (fietsT.DistanceTo(loc) < lowest)
{
lowest = fietsT.DistanceTo(loc);
closest = ft;
}
}
}
Location closestF = new Location("");
double closLat = Convert.ToDouble(closest.xcoord.Replace('.', ','));
double closLon = Convert.ToDouble(closest.ycoord.Replace('.', ','));
closestF.Latitude = closLat;
closestF.Longitude = closLon;
}
示例4: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.dashboard_listview_detail);
progress = new ProgressDialog (this);
lat = 37.09035962;
lan = -95.71368456;
flag = FindViewById<ImageView> (Resource.Id.ivNew1);
flag.Click += Flag_Click;
ivListEmpty = FindViewById<LinearLayout> (Resource.Id.ivEmptylist);
lvlist = FindViewById<ListView> (Resource.Id.lvListDetail);
llMap = FindViewById<RelativeLayout> (Resource.Id.llmap);
tvnumber = FindViewById<TextView> (Resource.Id.tvNumber);
tvdesc = FindViewById<TextView> (Resource.Id.tvdesc);
tvtime = FindViewById<TextView> (Resource.Id.tvTime);
tvreply = FindViewById<TextView> (Resource.Id.tvReply);
ListSipp = new List<SippReplyModel> ();
Typeface tf = Typeface.CreateFromAsset (Application.Context.Assets, "fonts/OpenSans-Light.ttf");
Typeface tf1 = Typeface.CreateFromAsset (Application.Context.Assets, "fonts/OpenSans-Semibold.ttf");
Typeface tf2 = Typeface.CreateFromAsset (Application.Context.Assets, "fonts/OpenSans-Bold.ttf");
adapter = new CustomListViewDetail (this, ListSipp);
lvlist.Adapter = adapter;
if (adapter.IsEmpty) {
ivListEmpty.Visibility = ViewStates.Visible;
} else {
ivListEmpty.Visibility = ViewStates.Gone;
}
mapFrag = (MapFragment)FragmentManager.FindFragmentById (Resource.Id.map);
map = mapFrag.Map;
map.UiSettings.CompassEnabled = true;
map.UiSettings.ZoomControlsEnabled = false;
map.MyLocationEnabled = false;
LatLng lastLatLng = new LatLng (lat, lan);
map.MoveCamera (CameraUpdateFactory.NewLatLngZoom (lastLatLng, 15));
MarkerOptions marker = new MarkerOptions ();
marker.SetPosition (new LatLng (lat, lan));
map.AddMarker (marker);
llMap.Background.SetAlpha (200);
llMap.Click += LlMap_Click;
tvnumber.SetTypeface (tf, TypefaceStyle.Normal);
tvnumber.SetTypeface (tf2, TypefaceStyle.Normal);
tvtime.SetTypeface (tf1, TypefaceStyle.Normal);
tvreply.SetTypeface (tf1, TypefaceStyle.Normal);
}
示例5: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.map_activity);
lat = Intent.GetDoubleExtra ("lat", 0);
lan = Intent.GetDoubleExtra ("lan", 0);
mapFrag = (MapFragment)FragmentManager.FindFragmentById (Resource.Id.map);
map = mapFrag.Map;
map.UiSettings.CompassEnabled = true;
map.UiSettings.ZoomControlsEnabled = true;
LatLng lastLatLng = new LatLng (lat, lan);
map.MoveCamera (CameraUpdateFactory.NewLatLngZoom (lastLatLng, 15));
MarkerOptions marker = new MarkerOptions ();
marker.SetPosition (new LatLng (lat, lan));
map.AddMarker (marker);
}
示例6: OnResume
protected override void OnResume()
{
base.OnResume();
var mapFragment = (SupportMapFragment) SupportFragmentManager.FindFragmentByTag("map");
// The value of mapFragment.Map may be null if the mapFragment isn't completely initialize yet.
// This will cause problems with other things too, like the CameraUpdateFactory.
// By initializing our GoogleMap here in OnResume, the MapFragment should be
// properly instantiated and ready for use.
_map = mapFragment.Map;
Debug.Assert(_map != null, "The _map cannot be null!");
// We create an instance of CameraUpdate, and move the map to it.
var cameraUpdate = CameraUpdateFactory.NewLatLngZoom(VimyRidge, 15);
_map.MoveCamera(cameraUpdate);
}
示例7: OnAttached
protected override void OnAttached()
{
var mapView = Control as MapView;
if(mapView == null)
return;
behavior = (MapExtensionBehavior) (Element as Map)?.Behaviors?.FirstOrDefault(x =>
x is MapExtensionBehavior);
if(behavior == null)
return;
var zoomButton = mapView.FindViewById(1); // ズームボタン LinearLayout
if(zoomButton != null)
{
zoomButton.Visibility = Android.Views.ViewStates.Invisible;
}
var locationButton = mapView.FindViewById(2); // 現在位置ボタン ImageView
if(locationButton != null)
{
locationButton.Visibility = Android.Views.ViewStates.Invisible;
}
var callback = new OnMapReadyCallback();
callback.MapReady += (sender, e) => {
googleMap = callback.GoogleMap;
googleMap.MyLocationChange += GoogleMap_MyLocationChange;
// なぜかCameraChangeにハンドラを追加するとXF.Maps.Map.VisibleRegionが更新されなくなる
// googleMap.CameraChange += GoogleMap_CameraChange;
var point = new LatLng(
XFAedSearch.Droid.Helpers.Settings.Latitude,
XFAedSearch.Droid.Helpers.Settings.Longitude);
googleMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(point,
XFAedSearch.Droid.Helpers.Settings.ZoomLevel));
googleMap.SetOnMapLoadedCallback(new MapLoadedCallback {
OnMapLoadedAction = () => MapLoaded?.Invoke(this, new EventArgs())
});
};
mapView.GetMapAsync(callback);
}
示例8: 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.");
}
示例9: CargamosMarcadores
void CargamosMarcadores ()
{
if (mMap == null)
{
mMap = _mapFragment.Map;
if (mMap != null)
{
//Relizamos un ciclo para cargar todas las ciudades en nuestro mapa y le asignamos un puntero de color azul
foreach (Ciudad_Marca ciudad in MisCiudades)
{
ciudad.Marcador=mMap.AddMarker(new MarkerOptions()
.SetPosition(ciudad.Ubicacion)
.SetTitle(ciudad.Nombre)
.SetSnippet(ciudad.Descripcion)
.InvokeIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueAzure)));
}
mMap.SetOnMapLongClickListener (this);
mMap.SetOnMarkerDragListener(this);
//Le indicamos que deve de cargar un ventana de información personalizada
mMap.SetInfoWindowAdapter (new CustomInfoWindowAdapter (this,MisCiudades));
//Ubicamos la cámara en un posición que se puedan ver las marcas
mMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng ( 21.12806,-101.689163), 6));
}
}
}
示例10: 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));
}
示例11: OnMapReady
public void OnMapReady (GoogleMap googleMap)
{
this.map = googleMap;
MapsInitializer.Initialize (Activity.ApplicationContext);
// Default map initialization
googleMap.MyLocationEnabled = true;
googleMap.UiSettings.MyLocationButtonEnabled = false;
googleMap.MarkerClick += HandleMarkerClick;
googleMap.MapClick += HandleMapClick;
var oldPosition = PreviousCameraPosition;
if (oldPosition != null)
googleMap.MoveCamera (CameraUpdateFactory.NewCameraPosition (oldPosition));
}
示例12: OnMapReady
public void OnMapReady(GoogleMap googleMap)
{
map = googleMap;
MapsInitializer.Initialize (Activity.ApplicationContext);
map.MapClick += HandleMapClick;
map.MarkerClick += HandleMapMarkerClick;
map.UiSettings.CompassEnabled = false;
map.UiSettings.MyLocationButtonEnabled = false;
map.UiSettings.MapToolbarEnabled = false;
var markerLatLong = new LatLng (Place.Geometry.Location.Latitude, Place.Geometry.Location.Longitude);
var markerOptions = new MarkerOptions ();
markerOptions.SetTitle (Place.Name);
markerOptions.SetPosition (markerLatLong);
map.AddMarker (markerOptions);
map.MoveCamera (CameraUpdateFactory.NewLatLng (markerLatLong));
}
示例13: OnCreate
//.........这里部分代码省略.........
}else{
subcategoria.Text=objeto["subcategoria"];
}
//likes
likes.Text=objeto["likes"]+" Personas";
//mapa?
try{
mapFrag = (MapFragment)FragmentManager.FindFragmentById(Resource.Id.map);
map = mapFrag.Map;
LatLng location = new LatLng(objeto["geo_lat"], objeto["geo_long"]);
CameraPosition.Builder builder = CameraPosition.InvokeBuilder();
builder.Target(location);
builder.Zoom(16);
//builder.Bearing(155);
//builder.Tilt(65);
CameraPosition cameraPosition = builder.Build();
CameraUpdate cameraUpdate = CameraUpdateFactory.NewCameraPosition(cameraPosition);
if (map != null)
{
map.MapType = GoogleMap.MapTypeNormal;
MarkerOptions markerOpt1 = new MarkerOptions();
markerOpt1.SetPosition(new LatLng(objeto["geo_lat"], objeto["geo_long"]));
markerOpt1.SetTitle(objeto["titulo"]);
markerOpt1.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.pliflocation3));
markerOpt1.Draggable(true);
map.AddMarker(markerOpt1);
map.MoveCamera(cameraUpdate);
}
}catch(Exception ex){
Log.Debug (tag, "GMAPS ERROR:"+ex);
}
//direccion
TextView callenum = FindViewById<TextView> (Resource.Id.callenum);
callenum.Text=objeto["geo_calle"]+" "+objeto["geo_numero"];
TextView colonia = FindViewById<TextView> (Resource.Id.colonia);
colonia.Text=objeto["geo_colonia"];
TextView regpais = FindViewById<TextView> (Resource.Id.regpais);
regpais.Text=objeto["geo_estado"]+", "+objeto["geo_pais"];
//acerca de este negocio
TextView mapmarker1 = FindViewById<TextView> (Resource.Id.sobreeste);
mapmarker1.SetTypeface(font, TypefaceStyle.Normal);
TextView descripcion = FindViewById<TextView> (Resource.Id.descripcion);
string desc=objeto["descripcion"];
descripcion.Text=System.Net.WebUtility.HtmlDecode(desc);
descripcion.Visibility=ViewStates.Gone;
WebView descweb = FindViewById<WebView> (Resource.Id.descweb);
descweb.Settings.JavaScriptEnabled=true;
string div1="<div style=\"color: #FFFFFF\">";
string div2="</div>";
示例14: OnMapReady
public void OnMapReady(GoogleMap googleMap)
{
mMap = googleMap;
double lat = 13.7310;
double lng = -89.1610;
if (!this.geolocator.IsGeolocationAvailable || !this.geolocator.IsGeolocationEnabled) {
alert.SetMessage ("Internet o GPS estan desactivados");
alert.Show ();
LatLng latlng = new LatLng (lat, lng);
CameraUpdate marca_camera = CameraUpdateFactory.NewLatLngZoom (latlng, 12);
mMap.MoveCamera (marca_camera);
} else {
this.geolocator.GetPositionAsync (timeout: 10000).ContinueWith (t => {
lat = t.Result.Latitude;
lng = t.Result.Longitude;
LatLng latlng = new LatLng (lat, lng);
CameraUpdate marca_camera = CameraUpdateFactory.NewLatLngZoom (latlng, 12);
mMap.MoveCamera (marca_camera);
}, TaskScheduler.FromCurrentSynchronizationContext ());
}
//MarkerOptions marca = new MarkerOptions()
// .SetPosition(latlng)
// .SetTitle("El Salvador")
// .SetSnippet("San Salvador")
// .Draggable(true);
mMap.MarkerDragEnd +=mMap_MarkerDragEnd;
//mMap.MarkerClick +=mMap_MarkerClick;
mMap.MarkerDrag += mMap_MarkerDrag;
mMap.SetInfoWindowAdapter(this);
mMap.SetOnInfoWindowClickListener(this);
}
示例15: OnMapReady
public void OnMapReady (GoogleMap googleMap)
{
map = googleMap;
map.MoveCamera (CameraUpdateFactory.NewLatLngZoom (new LatLng (37.614631, -122.385153), 18));
}