1

I started Google map in android few days age. I am doing some basic things like set marker on tap, draw line between two marker etc.

Here users can draw polygon with tapping on the device. Now i want to edit the shape. I goggled it but didn't find any helpful solution for android.

I found some resource on google map java script API like user-editable-shapes in javascript

I want to do the same in android. How to Edit or Modify polygon in Google Map Android API

It will be helpful if u provide some resource.

Mayur Prajapati
  • 5,454
  • 7
  • 41
  • 70
Sadid Khan
  • 1,836
  • 20
  • 35
  • 1
    I know there's an `editable:true` property you can set in v3 (Javascript), but I don't think such functionality exists for v2 (Android). It's a bit hacky, but I think what you'd have to do is set up a listener for when you click on a point on the polygon's perimeter, then edit that point and redraw the polygon while you drag. – not_a_bot Aug 18 '15 at 23:19

1 Answers1

2

It looks to me like you have to replace all the points at once with setPoints on the polygon object.

https://developers.google.com/android/reference/com/google/android/gms/maps/model/Polygon.html#setPoints(java.util.List)

I'm currently trying to do the same thing in Xamarin. I mock up an edit mode when the user clicks on the polygon by changing its stroke color and then adding custom markers to each vertex. I'm holding a selected vertex which will move to the user's next click on the map and update the polygon.