Dragging polygons on google maps for iOS

540 Views Asked by At

is there any draggable property for GMSPolygon in google maps ? like there is for GMSMarker ? or is it possible to make such ?

1

There are 1 best solutions below

0
Rohan On

No, unfortunately there is no such api in Google Map to achieve draggable polygon.

You need to store/track all your updating marker coordinates and need to redraw polygon with updated marker coordinates every time when following delegate gets called;

-(void)mapView:(GMSMapView *)mapView didEndDraggingMarker:(GMSMarker *)marker

You can get reference/idea from sample code;

    lati1 =  marker.position.latitude;
    longi1 =  marker.position.longitude;

    lati2 =  lati1 + 0.10;
    longi2 =  longi1 + 0.10;

    lati3 = lati1 + 0.15;
    longi3 =  longi1 + 0.05;

    lati4 =  lati1 + 0.05;
    longi4 =  longi1 - 0.05;

Hope this help.