本文整理汇总了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));
}
示例2: OnMapReady
public void OnMapReady(GoogleMap googleMap)
{
_map = googleMap;
if (_map != null)
_map.MapClick += googleMap_MapClick;
}
示例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 ();
}
示例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));
}
示例5: OnMapReady
public void OnMapReady(GoogleMap googleMap)
{
map = googleMap;
map.UiSettings.MyLocationButtonEnabled = false;
map.UiSettings.ZoomControlsEnabled = false;
CreateMarker();
}
示例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;
}
示例7: OnMapReady
public void OnMapReady (GoogleMap googleMap)
{
map = googleMap;
map.UiSettings.ZoomControlsEnabled = false;
map.MoveCamera (CameraUpdateFactory.NewLatLngZoom (new LatLng (-33.87365, 151.20689), 10));
}
示例8: OnMapReady
public void OnMapReady (GoogleMap googleMap)
{
map = googleMap;
updateTraffic ();
updateMyLocation ();
updateBuildings ();
updateIndoor ();
}
示例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));
}
示例10: OnMapReady
public void OnMapReady(GoogleMap googleMap)
{
Map = googleMap;
var handler = MapReady;
if (handler != null)
handler (this, EventArgs.Empty);
}
示例11: OnMapReady
public void OnMapReady (GoogleMap map)
{
googleMap = map;
googleMap.UiSettings.CompassEnabled = false;
googleMap.UiSettings.MyLocationButtonEnabled = false;
googleMap.UiSettings.MapToolbarEnabled = false;
UpdateLocations ();
}
示例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;
}
示例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);
}
示例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);
}
示例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