suchen

Heim  >  Fragen und Antworten  >  Hauptteil

ios - 关于高德开发平台的划线功能

想实现在地图上划线的功能,于是按照api手册写了以下代码:

NSLog(@"划线");
MAMapPoint *arrayPoint = malloc(sizeof(MAMapPoint) * 2);
arrayPoint[0] = MAMapPointMake(38.7f, 117.48f);
arrayPoint[1] = MAMapPointMake(50.6f, 117.48f);
MAPolyline *line = [MAPolyline polylineWithPoints:arrayPoint count:2];
[self.mapView addOverlay: line];
free(arrayPoint);

但是地图上不显示根据这两个点所化的直线。请问这是什么原因?

PHP中文网PHP中文网2887 Tage vor330

Antworte allen(1)Ich werde antworten

  • ringa_lee

    ringa_lee2017-04-17 17:32:30

    是不是应该实现overlay的代理?

    Antwort
    0
  • StornierenAntwort