coderslay
coderslay

Reputation: 14370

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....

enter image description here

Upvotes: 0

Views: 347

Answers (1)

Lyrkan
Lyrkan

Reputation: 1063

  • 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

Upvotes: 1

Related Questions