Note that there are some explanatory texts on larger screens.

plurals
  1. POMyLocationOverlay - Custom image, but no shadow
    text
    copied!<p>I have an application, which uses a custom implementation of <em>MyLocationOverlay</em>.</p> <p>In the implementation I set a Bitmap property that is used when it has been specified, by an overload of Draw.</p> <p>It works nicely, using my custom image, <strong>but it doesn't display a shadow</strong> - as is done automatically in an <em>ItemizedOverlay</em>.</p> <p>Can anyone help?</p> <p>Here is (the relevant code from) my class:</p> <pre><code>public class LocationOverlay: MyLocationOverlay { /// &lt;summary&gt;Bitmap to use for indicating the current fixed location.&lt;/summary&gt; public Bitmap LocationMarker { get; set; } /// &lt;summary&gt;Uses the custom marker bitmap if one has been specified. Otherwise, the default is used.&lt;/summary&gt; /// &lt;param name="canvas"&gt;&lt;/param&gt; /// &lt;param name="mapView"&gt;&lt;/param&gt; /// &lt;param name="shadow"&gt;&lt;/param&gt; /// &lt;param name="when"&gt;&lt;/param&gt; /// &lt;returns&gt;&lt;/returns&gt; public override bool Draw(Canvas canvas, MapView mapView, bool shadow, long when) { var drawShadow = shadow; if (LocationMarker != null &amp;&amp; LastFix != null) { var screenPoint = new Point(); var geoPoint = new GeoPoint((int)(LastFix.Latitude * 1E6), (int)(LastFix.Longitude * 1E6)); mapView.Projection.ToPixels(geoPoint, screenPoint); canvas.DrawBitmap(LocationMarker, screenPoint.X, screenPoint.Y - 32, null); drawShadow = true; } base.Draw(canvas, mapView, drawShadow); return true; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload