简体   繁体   English

需要帮助创建覆盖,如 android 中的图片

[英]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....我需要做一个覆盖就像这个附加的图片......需要帮助......我需要标记一个 position 就像在红色的图片中......

在此处输入图像描述

  • Create a new class extending Overlay.创建一个新的 class 扩展 Overlay。
  • Use the constructor to pass it 4 GeoPoint in order to delimit your zone使用构造函数将其传递 4 GeoPoint 以划定您的区域
  • Override the boolean draw(Canvas canvas, MapView mapv, boolean shadow, long when) method:覆盖boolean draw(Canvas canvas, MapView mapv, boolean shadow, long when)方法:
    • Call super(canvas, mapv, shadow)调用super(canvas, mapv, shadow)
    • Create a path using your GeoPoints and the MapView projection: mapv.getProjection().toPixels(geopoint, newPoint)使用您的 GeoPoints 和 MapView 投影创建路径: mapv.getProjection().toPixels(geopoint, newPoint)
    • Use canvas.drawPath(path,paint) to draw the path使用canvas.drawPath(path,paint)绘制路径

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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