简体   繁体   中英

Need help to create overlay like in the pic in android

I need to make an overlay Just like this Attached Pic... Need help to make it... I need to mark a position just like in the pic with red....

在此处输入图像描述

  • Create a new class extending Overlay.
  • Use the constructor to pass it 4 GeoPoint in order to delimit your zone
  • Override the boolean draw(Canvas canvas, MapView mapv, boolean shadow, long when) method:
    • Call super(canvas, mapv, shadow)
    • Create a path using your GeoPoints and the MapView projection: mapv.getProjection().toPixels(geopoint, newPoint)
    • Use canvas.drawPath(path,paint) to draw the path

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM