JAK
JAK

Reputation: 6491

How to draw arrow on the endpoint of GMSPolyline in iOS?

I am using Google Map iOS sdk. I added polyline on my google map using the following code. But now I want add arrow at the end of this line. How to solve this issue?

GMSMutablePath *path = [GMSMutablePath path];
[path addLatitude:-37.81319 longitude:144.96298];
[path addLatitude:-31.95285 longitude:115.85734];
GMSPolyline *polyline = [GMSPolyline polylineWithPath:path];
polyline.strokeWidth = 3.f;
polyline.map = mapaView;

polyline must be look like this image

Upvotes: 2

Views: 991

Answers (1)

Dheeraj D
Dheeraj D

Reputation: 4451

You can use GMSMarker to indicate endpoint of your polyline:

    GMSMarker *marker = [[GMSMarker alloc] init];
    marker.position = CLLocationCoordinate2DMake(22.200000, 114.1333900);
    marker.title = @"Endpoint";
    marker.map = mapView;

Upvotes: 1

Related Questions