渲染一个面、一个区域,网上找到的代码是只是给出局部代码,缺少渲染符号,以及渲染符号的style,导致新手不能实现
本人使用具体代码如下,关键部分基本看出来
AGSSimpleFillSymbol *MarkerSymbol = [AGSSimpleFillSymbol simpleFillSymbol];
MarkerSymbol.color = [UIColor blueColor];
MarkerSymbol.style= AGSSimpleFillSymbolStyleSolid;
AGSMutablePolygon* poly = [[AGSMutablePolygon alloc] initWithSpatialReference:nil];
//添加环
[poly addRingToPolygon];
AGSPoint* points = [AGSPoint pointWithX:113 y:23 spatialReference:[AGSSpatialReference spatialReferenceWithWKID:GPSMercator WKT:nil]];
//添加节点
[poly addPointToRing:[self mapPointChangeto:points TO:kWebMercator]];
[poly addPointToRing:[self mapPointChangeto:[AGSPoint pointWithX:113 y:20 spatialReference:[AGSSpatialReference spatialReferenceWithWKID:GPSMercator WKT:nil]] TO:kWebMercator]];
[poly addPointToRing:[self mapPointChangeto:[AGSPoint pointWithX:114 y:20 spatialReference:[AGSSpatialReference spatialReferenceWithWKID:GPSMercator WKT:nil]] TO:kWebMercator]];
[poly addPointToRing:[self mapPointChangeto:[AGSPoint pointWithX:114 y:23 spatialReference:[AGSSpatialReference spatialReferenceWithWKID:GPSMercator WKT:nil]] TO:kWebMercator]];
[poly addPointToRing:[self mapPointChangeto:[AGSPoint pointWithX:113 y:23 spatialReference:[AGSSpatialReference spatialReferenceWithWKID:GPSMercator WKT:nil]] TO:kWebMercator]];