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];
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; }
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.