本文整理汇总了C#中Android.Gms.Maps.GoogleMap.SetInfoWindowAdapter方法的典型用法代码示例。如果您正苦于以下问题:C# GoogleMap.SetInfoWindowAdapter方法的具体用法?C# GoogleMap.SetInfoWindowAdapter怎么用?C# GoogleMap.SetInfoWindowAdapter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Gms.Maps.GoogleMap
的用法示例。
在下文中一共展示了GoogleMap.SetInfoWindowAdapter方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindMap
void FindMap ()
{
_map = (SupportFragmentManager.FindFragmentById (Resource.Id.map) as SupportMapFragment).Map;
if (_map != null) {
_map.MyLocationEnabled = true;
_map.UiSettings.TiltGesturesEnabled = false;
_map.UiSettings.RotateGesturesEnabled = false;
_map.MapClick += OnMapClick;
_map.MapLongClick += OnMapLongClick;
_map.MyLocationChange += HandleMyLocationChange;
_map.MarkerClick += OnMarkerClick;
_map.SetInfoWindowAdapter (new InfoWindowAdapter ());
// here because map should be already initialized
// http://developer.android.com/reference/com/google/android/gms/maps/model/BitmapDescriptorFactory.html
_alarm_marker_normal = BitmapDescriptorFactory.FromResource (Resource.Drawable.marker_violet);
_alarm_marker_normal_selected = BitmapDescriptorFactory.FromResource (Resource.Drawable.marker_violet_selected);
_alarm_marker_disabled_selected = BitmapDescriptorFactory.FromResource (Resource.Drawable.marker_grey_selected);
_alarm_marker_disabled = BitmapDescriptorFactory.FromResource (Resource.Drawable.marker_grey);
RefreshData ();
_map.SetOnMapLoadedCallback (this);
if (Mode == Mode.Add) {
if (AlarmToAddMarker != null) {
AlarmToAddMarker = _map.AddMarker (new MarkerOptions ().SetPosition (AlarmToAddMarker.Position).InvokeIcon (_alarm_marker_normal));
}
}
}
}
示例2: 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)));
}
//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));
}
}
}
示例3: OnMapReady
public void OnMapReady(GoogleMap googleMap)
{
globMap = googleMap;
markerColor = new Dictionary<string, HamsterColor>();
foreach ( var a in ViewModel.Markers) {
var markerOpt = new MarkerOptions();
double la = double.Parse(a.HamsterLatitude, System.Globalization.CultureInfo.InvariantCulture);
double lon = double.Parse (a.HamsterLongitude, System.Globalization.CultureInfo.InvariantCulture);
latlng = new LatLng (la, lon);
markerOpt.SetPosition (latlng);
markerOpt.SetTitle (String.Format("Name: {0} {1} ", a.FirstName, a.LastName));
markerOpt.SetSnippet (String.Format("Latitude: {0} Longitude: {1} ", a.HamsterLatitude, a.HamsterLongitude));
globMap.AddMarker(markerOpt);
markerColor.Add(String.Format("{0}{1}",markerOpt.Title, markerOpt.Snippet), a.Color);
}
globMap.MyLocationEnabled = true;
globMap.UiSettings.CompassEnabled = true;
globMap.UiSettings.MapToolbarEnabled = false;
globMap.UiSettings.ZoomControlsEnabled = true;
globMap.UiSettings.MyLocationButtonEnabled = false;
globMap.SetInfoWindowAdapter (this);
}
示例4: SetUpMapIfNeeded
private void SetUpMapIfNeeded(List<Feature> data)
{
if(null != _googleMap)
return;
CameraPosition.Builder builder = CameraPosition.InvokeBuilder ();
if (string.Compare (_selectedCity, "warszawa") == 0)
{
LatLng location = new LatLng (52.2333, 21.0167);
builder.Target (location);
builder.Zoom (11);
}
if (string.Compare (_selectedCity, "czestochowa") == 0)
{
LatLng location = new LatLng (50.8000, 19.1167);
builder.Target (location);
builder.Zoom (11);
}
CameraPosition cameraPosition = builder.Build ();
CameraUpdate cameraUpdate = CameraUpdateFactory.NewCameraPosition (cameraPosition);
var mapReadyCallback = new OnMapReadyClass();
mapReadyCallback.MapReady += (sender, e) =>
{
_googleMap = ((OnMapReadyClass)sender).Map;
_googleMap.MapType = GoogleMap.MapTypeNormal;
_googleMap.AnimateCamera(cameraUpdate);
GoogleMapHelpers.PlaceMarkersOnTheMap(data, _googleMap);
_googleMap.SetInfoWindowAdapter(new CustomMarkerPopupAdapter(LayoutInflater));
};
try {
if(_myMapFragment != null)
_myMapFragment.GetMapAsync(mapReadyCallback);
} catch (NullReferenceException ex) {
Console.WriteLine(ex.Source);
}
}
示例5: OnMapReady
public void OnMapReady (GoogleMap googleMap)
{
map = googleMap;
map.InfoWindowClick += OnInfoWindowClick;
map.SetInfoWindowAdapter (this);
}
示例6: 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);
}
示例7: OnMapReady
public void OnMapReady(GoogleMap googleMap)
{
googleMap = googleMap;
googleMap.SetInfoWindowAdapter (new CustomInfoWindow(Context, this, formsMap.CustomPins));
}
示例8: SetUpMapIfNeeded
private void SetUpMapIfNeeded()
{
if(null != _googleMap)
return;
CameraPosition.Builder builder = CameraPosition.InvokeBuilder ();
LatLng location = new LatLng (Convert.ToDouble(_latitude), Convert.ToDouble(_longitude));
builder.Target (location);
builder.Zoom (15);
CameraPosition cameraPosition = builder.Build ();
CameraUpdate cameraUpdate = CameraUpdateFactory.NewCameraPosition (cameraPosition);
var mapReadyCallback = new OnMapReadyClass();
mapReadyCallback.MapReady += (sender, e) =>
{
_googleMap = ((OnMapReadyClass)sender).Map;
_googleMap.MapType = GoogleMap.MapTypeNormal;
_googleMap.AnimateCamera(cameraUpdate);
List<Feature> data = new List<Feature>();
List<double> coord = new List<double> ();
coord.Add (Convert.ToDouble(_longitude));
coord.Add (Convert.ToDouble(_latitude));
_toilet = new Feature ()
{
type = "Feature",
geometry = new Geometry()
{
coordinates = coord,
type = "Point"
},
properties = new Properties()
{
ranking = "0",
id = "0",
name = _name,
icon = "znajdz_wc_logo_free_marker.png",
isFree = _isFree,
comment = _comment,
photo = "",
openHours = "",
isVerified = false,
}
};
data.Add(_toilet);
GoogleMapHelpers.PlaceMarkersOnTheMap(data, _googleMap);
_googleMap.SetInfoWindowAdapter(new CustomMarkerPopupAdapter(LayoutInflater));
};
try {
_myMapFragment.GetMapAsync(mapReadyCallback);
} catch (NullReferenceException ex) {
Console.WriteLine(ex.Source);
}
}