本文整理汇总了C#中Android.Gms.Maps.Model.Marker.ShowInfoWindow方法的典型用法代码示例。如果您正苦于以下问题:C# Marker.ShowInfoWindow方法的具体用法?C# Marker.ShowInfoWindow怎么用?C# Marker.ShowInfoWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Gms.Maps.Model.Marker
的用法示例。
在下文中一共展示了Marker.ShowInfoWindow方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddInitialPolarBarToMap
private void AddInitialPolarBarToMap()
{
MarkerOptions markerOptions = new MarkerOptions()
.SetSnippet("Click me to go on vacation.")
.SetPosition(LeaveFromHereToMaui)
.SetTitle("Goto Maui");
_polarBearMarker = _map.AddMarker(markerOptions);
_polarBearMarker.ShowInfoWindow();
_gotoMauiMarkerId = _polarBearMarker.Id;
PositionPolarBearGroundOverlay(LeaveFromHereToMaui);
}
示例2: OnMyLocationButtonClick
private void OnMyLocationButtonClick(object sender, GoogleMap.MyLocationButtonClickEventArgs e)
{
var myLocation = GetMyLocation();
if (myLocation == null)
{
Logger.Log("Brak sygna³u GPS.");
MessagingCenter.Send(_myMap, "DisplayAlert", new AlertMessage("B³¹d", "Brak sygna³u GPS."));
return;
}
var myLatLng = new Android.Gms.Maps.Model.LatLng(myLocation.Latitude, myLocation.Longitude);
// Create new starting marker.
if (_startMarker == null)
{
var marker = new MarkerOptions();
marker.SetPosition(myLatLng);
marker.SetTitle("Od");
marker.Draggable(true);
// TODO: Custom start icon.
_startMarker = _map.AddMarker(marker);
_startMarker.ShowInfoWindow();
}
// Move existing marker.
else
{
_startMarker.Position = myLatLng;
_startMarker.ShowInfoWindow();
}
_map.AnimateCamera(CameraUpdateFactory.NewLatLngZoom(myLatLng, DefaultZoom));
}
示例3: OnBtnLocalizeClicked
private void OnBtnLocalizeClicked(MapPage mapPage)
{
var myLocation = GetMyLocation();
if (myLocation == null)
{
Logger.Log("Brak sygna³u GPS.");
MessagingCenter.Send(_myMap, "DisplayAlert", new AlertMessage("B³¹d", "Brak sygna³u GPS."));
return;
}
var myLatLng = new Android.Gms.Maps.Model.LatLng(myLocation.Latitude, myLocation.Longitude);
// Create new starting marker.
if (_startMarker == null)
{
var marker = new MarkerOptions();
marker.SetPosition(myLatLng);
marker.SetTitle("Od");
marker.Draggable(false);
// TODO: Custom start icon.
_startMarker = _map.AddMarker(marker);
_startMarker.ShowInfoWindow();
}
// Move existing marker.
else
{
_startMarker.Position = myLatLng;
}
_map.AnimateCamera(CameraUpdateFactory.NewLatLngZoom(myLatLng, DefaultZoom));
// TODO: Display nearest stations.
var nearestStations = App.Database.GetNearestStations(myLatLng.Latitude, myLatLng.Longitude, 5);
for (var i = 0; i < nearestStations.Length; i++)
{
var station = nearestStations[i];
var marker = new MarkerOptions();
var latLng = new Android.Gms.Maps.Model.LatLng(station.latitude, station.longitude);
marker.SetPosition(latLng);
marker.SetTitle(string.Format("{0}. {1} - {2}", station.postId, station.postName, station.street));
marker.Draggable(false);
marker.SetSnippet("Wiêcej...");
// TODO: Custom stations's icon.
var mapMarker = _map.AddMarker(marker);
var stationMarker = new StationMarker(station, mapMarker);
_nearestMarkers.Add(stationMarker);
}
}
示例4: OnMapClick
private void OnMapClick(object sender, GoogleMap.MapClickEventArgs e)
{
var latlng = e.Point;
// Create new destination marker.
if (_destinationMarker == null)
{
var marker = new MarkerOptions();
marker.SetPosition(latlng);
marker.SetTitle("Do");
marker.Draggable(true);
marker.SetSnippet("Punkt docelowy");
// TODO: Custom destination icon.
_destinationMarker = _map.AddMarker(marker);
_destinationMarker.ShowInfoWindow();
}
// Move existing marker.
else
{
_destinationMarker.Position = latlng;
_destinationMarker.ShowInfoWindow();
}
}
示例5: AddInitialNewYorkBarToMap
private void AddInitialNewYorkBarToMap()
{
MarkerOptions markerOptions = new MarkerOptions()
.SetSnippet("Click me to visit New York.")
.SetPosition(Location_NewYork)
.SetTitle("Goto New York");
_newYorkMarker = _map.AddMarker(markerOptions);
_newYorkMarker.ShowInfoWindow();
_gotoNewYorkMarkerID = _newYorkMarker.Id;
}
示例6: AddPlaceMarker
/// <summary>
/// add a marker for resolved adresses or map long click
/// </summary>
/// <param name="position"></param>
private void AddPlaceMarker(LatLng position, string title, string snippet)
{
RunOnUiThread(() =>
{
if (longClickMarker != null)
{
// Remove a previously created marker
longClickMarker.Remove();
}
var markerOptions = new MarkerOptions().SetPosition(position);
// Create and show the marker
longClickMarker = _map.AddMarker(markerOptions);
_selectedMarker = longClickMarker;
longClickMarker.Title = title ?? Resources.GetString(Resource.String.mapMarkerResolving);
longClickMarker.Snippet = snippet ?? FormatLatLng(position);
longClickMarker.ShowInfoWindow();
if (ActionMode != null)
{
ActionMode.Finish();
}
ActionMode = StartSupportActionMode(this);
});
}
示例7: _map_MarkerClick
private void _map_MarkerClick(object sender, GoogleMap.MarkerClickEventArgs e)
{
if (e.Marker.Title == "cluster")
{
UnStickUserLocation();
_map.AnimateCamera(CameraUpdateFactory.NewLatLngZoom(e.Marker.Position, 16));
}
else
{
_selectedMarker = e.Marker;
SelectItem(_selectedMarker.Position);
if (string.IsNullOrWhiteSpace(_selectedMarker.Title)
|| _selectedMarker.Title == Resources.GetString(Resource.String.mapMarkerImpossible)
|| _selectedMarker.Title == Resources.GetString(Resource.String.mapMarkerResolving))
{
_selectedMarker.Title = Resources.GetString(Resource.String.mapMarkerResolving);
}
_selectedMarker.Snippet = FormatLatLng(e.Marker.Position);
_selectedMarker.ShowInfoWindow();
AnimateStation(e.Marker);
}
}
示例8: GetInfoWindow
public View GetInfoWindow(Marker marker)
{
View view;
byte[] image;
if (marker.Snippet != "customMarker")
{
view = LayoutInflater.Inflate(Resource.Layout.info_window, null, false);
var denuncia = (from d in Denuncias
where d.iddenuncia == Convert.ToInt32(marker.Snippet)
select d).ToList()[0];
if (denuncia.imagebase64.Length <= 0) {
//Toast.MakeText (this, "Cargando...", ToastLength.Short).Show();
clienteUpload = new WebClient ();
NameValueCollection parametros = new NameValueCollection ();
parametros.Add ("iddenuncia",denuncia.iddenuncia.ToString());
clienteUpload.UploadValuesAsync (WebServices["getDenunciaPicture"],parametros);
clienteUpload.UploadValuesCompleted += (object sender, UploadValuesCompletedEventArgs e) => {
RunOnUiThread(() =>
{
string result = Encoding.UTF8.GetString(e.Result);
//eliminando datos basura de 000webhost
result = result.Replace("<!-- Hosting24 Analytics Code -->","");
result = result.Replace("<script type=\"text/javascript\" src=\"http://stats.hosting24.com/count.php\"></script>","");
result = result.Replace("<!-- End Of Analytics Code -->","");
result = result.Replace("\n","");
result = result.Replace("\t","");
result = result.Trim();
denuncia.imagebase64 = result;
Console.WriteLine(denuncia.imagebase64);
if (denuncia.imagebase64 != null && denuncia.imagebase64 != "" && denuncia.imagebase64.Length > 0)
{
image = Convert.FromBase64String(denuncia.imagebase64);
view.FindViewById<ImageView>(Resource.Id.denuncia_miniatura).SetImageBitmap(BitmapFactory.DecodeByteArray(image, 0, image.Length));
marker.ShowInfoWindow();
}
});
};
}
view.FindViewById<TextView>(Resource.Id.txtNombre).Text = denuncia.nombretipo;
view.FindViewById<TextView>(Resource.Id.txtDireccion).Text = denuncia.ciudad + ", " + denuncia.calle;
view.FindViewById<TextView>(Resource.Id.txtNumero).Text = "Por " + denuncia.nombre;
if (denuncia.imagebase64 != null && denuncia.imagebase64 != "" && denuncia.imagebase64.Length > 0) {
image = Convert.FromBase64String (denuncia.imagebase64);
view.FindViewById<ImageView> (Resource.Id.denuncia_miniatura).SetImageBitmap (BitmapFactory.DecodeByteArray (image, 0, image.Length));
}
}
else
{
view = LayoutInflater.Inflate(Resource.Layout.DenunciarInfoWindow, null, false);
view.FindViewById<TextView>(Resource.Id.txtvInfoCalle).Text = address.FeatureName;
view.FindViewById<TextView>(Resource.Id.txtvInfoCiudad).Text = address.Locality;
view.FindViewById<TextView>(Resource.Id.txtvInfoPais).Text = address.CountryName;
}
return view;
}
示例9: addCustomMarker
public void addCustomMarker(double lat, double lng)
{
if (customMarker != null)
{
customMarker.Remove();
}
customMarker = mMap.AddMarker(new MarkerOptions()
.SetPosition(new LatLng(lat, lng))
.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.customMarker))
.SetSnippet("customMarker")
.Draggable(true));
customMarker.ShowInfoWindow();
}