Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Okay, I tried to do things on my Own, and put this code to get the above effect:</p> <pre><code>public class MarkerOverlay extends Overlay { Geocoder geoCoder = null; public MarkerOverlay() { super(); } @Override public boolean onTap(GeoPoint geoPoint, MapView mapView){ selectedLatitude = geoPoint.getLatitudeE6(); selectedLongitude = geoPoint.getLongitudeE6(); return super.onTap(geoPoint,mapView); } @Override public void draw(Canvas canvas, MapView mapV, boolean shadow){ if(shadow){ Projection projection = mapV.getProjection(); Point pt = new Point(); projection.toPixels(globalGeoPoint,pt); GeoPoint newGeos = new GeoPoint(selectedLat+(100),selectedLong); // adjust your radius accordingly Point pt2 = new Point(); projection.toPixels(newGeos,pt2); float circleRadius = Math.abs(pt2.y-pt.y); Paint circlePaint = new Paint(Paint.ANTI_ALIAS_FLAG); circlePaint.setColor(0x30000000); circlePaint.setStyle(Style.FILL_AND_STROKE); canvas.drawCircle((float)pt.x, (float)pt.y, circleRadius, circlePaint); circlePaint.setColor(0x99000000); circlePaint.setStyle(Style.STROKE); canvas.drawCircle((float)pt.x, (float)pt.y, circleRadius, circlePaint); Bitmap markerBitmap = BitmapFactory.decodeResource(getApplicationContext().getResources(),R.drawable.pin); canvas.drawBitmap(markerBitmap,pt.x,pt.y-markerBitmap.getHeight(),null); super.draw(canvas,mapV,shadow); } } } </code></pre> <p>This let me have following effect:</p> <p><img src="https://i.stack.imgur.com/1F3kg.png" alt="Effect on Map"></p> <p>The calculation used may not be what you want.<br/> Its just for demonstration purposes.<br/> Real range/distance calculation requires the use of bearing too and has some specific formula.<br/> Let me know if you have any questions regarding this.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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