AGSPoint* centerPoint = [AGSPoint pointWithX:longitude y:latitude spatialReference:[AGSSpatialReference wgs84SpatialReference]]; AGSPoint *webMercatorPoint = (AGSPoint *)[[AGSGeometryEngine defaultGeometryEngine] projectGeometry:centerPoint toSpatialReference:[AGSSpatialReference webMercatorSpatialReference]]; AGSPolygon *polygon = [self circleWithCenter:webMercatorPoint radius:rangeInMeters]; AGSGraphic *graphic = [AGSGraphic graphicWithGeometry:polygon symbol:nil attributes:nil]; [self.markerGraphicsLayer addGraphic:graphic];
Solved! Go to Solution.
AGSPoint* centerPoint = [AGSPoint pointWithX:longitude y:latitude spatialReference:[AGSSpatialReference wgs84SpatialReference]]; AGSPolygon *polygon = [self circleWithCenter:webMercatorPoint radius:rangeInMeters]; AGSGraphic *graphic = [AGSGraphic graphicWithGeometry:polygon symbol:[AGSSimpleFillSymbol simpleFillSymbol] attributes:nil]; [self.markerGraphicsLayer addGraphic:graphic];
-(AGSPolygon*) circleWithCenter:(AGSPoint*)point radius:(double)radiusInMeters { AGSGeometryEngine *ge = [AGSGeometryEngine defaultGeometryEngine]; AGSPoint *pointToBufferAround = (AGSPoint *)[ge projectGeometry:point toSpatialReference:[AGSSpatialReference webMercatorSpatialReference]]; AGSPolygon *circle = [ge bufferGeometry:pointToBufferAround byDistance:radiusInMeters]; return circle; }
AGSPoint* centerPoint = [AGSPoint pointWithX:longitude y:latitude spatialReference:[AGSSpatialReference wgs84SpatialReference]]; AGSPolygon *polygon = [self circleWithCenter:webMercatorPoint radius:rangeInMeters]; AGSGraphic *graphic = [AGSGraphic graphicWithGeometry:polygon symbol:[AGSSimpleFillSymbol simpleFillSymbol] attributes:nil]; [self.markerGraphicsLayer addGraphic:graphic];
-(AGSPolygon*) circleWithCenter:(AGSPoint*)point radius:(double)radiusInMeters { AGSGeometryEngine *ge = [AGSGeometryEngine defaultGeometryEngine]; AGSPoint *pointToBufferAround = (AGSPoint *)[ge projectGeometry:point toSpatialReference:[AGSSpatialReference webMercatorSpatialReference]]; AGSPolygon *circle = [ge bufferGeometry:pointToBufferAround byDistance:radiusInMeters]; return circle; }