本文整理汇总了C#中Android.Gms.Maps.Model.Marker.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Marker.Equals方法的具体用法?C# Marker.Equals怎么用?C# Marker.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Gms.Maps.Model.Marker
的用法示例。
在下文中一共展示了Marker.Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnMarkerClick
//
// Marker related listeners.
//
public bool OnMarkerClick(Marker marker)
{
// This causes the marker at Perth to bounce into position when it is clicked.
if (marker.Equals(mPerth)) {
Handler handler = new Handler ();
long start = SystemClock.UptimeMillis ();
Projection proj = mMap.Projection;
Point startPoint = proj.ToScreenLocation(PERTH);
startPoint.Offset(0, -100);
LatLng startLatLng = proj.FromScreenLocation(startPoint);
long duration = 1500;
IInterpolator interpolator = new BounceInterpolator();
Runnable run = null;
run = new Runnable (delegate {
long elapsed = SystemClock.UptimeMillis () - start;
float t = interpolator.GetInterpolation ((float) elapsed / duration);
double lng = t * PERTH.Longitude + (1 - t) * startLatLng.Longitude;
double lat = t * PERTH.Latitude + (1 - t) * startLatLng.Latitude;
marker.Position = (new LatLng(lat, lng));
if (t < 1.0) {
// Post again 16ms later.
handler.PostDelayed(run, 16);
}
});
handler.Post(run);
}
// We return false to indicate that we have not consumed the event and that we wish
// for the default behavior to occur (which is for the camera to move such that the
// marker is centered and for the marker's info window to open, if it has one).
return false;
}
示例2: Render
private void Render (Marker marker, View view) {
int badge;
// Use the equals() method on a Marker to check for equals. Do not use ==.
if (marker.Equals(parent.mBrisbane)) {
badge = Resource.Drawable.badge_qld;
} else if (marker.Equals(parent.mAdelaide)) {
badge = Resource.Drawable.badge_sa;
} else if (marker.Equals(parent.mSydney)) {
badge = Resource.Drawable.badge_nsw;
} else if (marker.Equals(parent.mMelbourne)) {
badge = Resource.Drawable.badge_victoria;
} else if (marker.Equals(parent.mPerth)) {
badge = Resource.Drawable.badge_wa;
} else {
// Passing 0 to setImageResource will clear the image view.
badge = 0;
}
((ImageView) view.FindViewById (Resource.Id.badge)).SetImageResource (badge);
String title = marker.Title;
TextView titleUi = ((TextView) view.FindViewById (Resource.Id.title));
if (title != null) {
// Spannable string allows us to edit the formatting of the text.
SpannableString titleText = new SpannableString (title);
SpanTypes st = (SpanTypes) 0;
// FIXME: this somehow rejects to compile
//titleText.SetSpan (new ForegroundColorSpan(Color.Red), 0, titleText.Length, st);
titleUi.TextFormatted = (titleText);
} else {
titleUi.Text = ("");
}
String snippet = marker.Snippet;
TextView snippetUi = ((TextView) view.FindViewById(Resource.Id.snippet));
if (snippet != null) {
SpannableString snippetText = new SpannableString(snippet);
snippetText.SetSpan(new ForegroundColorSpan(Color.Magenta), 0, 10, 0);
snippetText.SetSpan(new ForegroundColorSpan(Color.Blue), 12, 21, 0);
snippetUi.TextFormatted = (snippetText);
} else {
snippetUi.Text = ("");
}
}
示例3: OnMarkerClick
public bool OnMarkerClick(Marker marker)
{
if(marker.Equals(currentLocationMarker))
{
if (_markerClick) {
CameraPosition pos = new CameraPosition.Builder ().Target (coord).Zoom (17).Tilt (90).Build ();
map.AnimateCamera (CameraUpdateFactory.NewCameraPosition (pos));
}
else
{
CameraPosition pos = new CameraPosition.Builder ().Target (coord).Zoom (17).Build ();
map.AnimateCamera (CameraUpdateFactory.NewCameraPosition (pos));
//CameraUpdate update = CameraUpdateFactory.NewLatLngZoom(coord, 17);
//map.AnimateCamera(update);
}
}
_markerClick = !_markerClick;
return true;
}