ArcGIS 测距 添加相邻点之间的距离

 self.sketchLayer = [AGSSketchGraphicsLayer graphicsLayer];

        

        AGSSpatialReference *sccc = [AGSSpatialReference spatialReferenceWithWKID:4490];

        

        self.sketchLayer.geometry = [[AGSMutablePolyline alloc] initWithSpatialReference:sccc];

        [self.KMMapView addMapLayer:self.sketchLayer withName:@"Sketch layer"];

        self.KMMapView.touchDelegate = self.sketchLayer;

        

        self.sketchLayer.geometry = [[AGSMutablePolyline alloc] initWithSpatialReference:self.KMMapView.spatialReference];

        self.sketchLayer.selectedVertexSymbol.color = [UIColor colorWithRed:78.0/255.f green:158.0/255.f blue:237.0/255.f alpha:1.0];


        

        AGSTextSymbol *ts = [[AGSTextSymbol alloc] initWithText:[NSString stringWithFormat:@"%f",self.distance] color:[UIColor blueColor]];

        ts.backgroundColor = [UIColor whiteColor];

        ts.vAlignment = AGSTextSymbolVAlignmentMiddle;

        ts.hAlignment = AGSTextSymbolHAlignmentCenter;

        ts.fontSize = 14;


//最重要就是添加下面这句话,设置成草图层的中心symbol!

        self.sketchLayer.midVertexSymbol = ts;



你可能感兴趣的:(ios移动开发学习,ArcGIS,测距)