How to do freehand drawing in Google Maps on iOS?

后端 未结 3 586
遥遥无期
遥遥无期 2020-12-18 07:59

In drawing application we can identify when the user is starting to draw and moving the finger to make a line/shape. I\'m trying to do the same on a map, how can I do this?<

3条回答
  •  青春惊慌失措
    2020-12-18 09:02

    To draw a line use polyline. Refer to Google Maps Shapes.

    To use polyline you need to give locatoin coordinates. To convert a point on screen to coordinate use coordinateForPoint:(CGPoint)point method of GMSProjection class.

    Polyline actually draws a line between two coordinates. Thus, with moving mapView those lines will move, too. I think this is what you want.

提交回复
热议问题