With this code:
AGSPoint *aucklandmappoint =[[AGSPoint alloc] initWithX:aucklandMecPoint.x y:aucklandMecPoint.y spatialReference:[AGSSpatialReference spatialReferenceWithWKID:4326]];
AGSPoint *losangelesmappoint =[[AGSPoint alloc] initWithX:losangelesMecPoint.x y:losangelesMecPoint.y spatialReference:[AGSSpatialReference spatialReferenceWithWKID:4326] ];
[self.graphicsLayer removeAllGraphics];
AGSMutablePolyline *polyline = [[AGSMutablePolyline alloc] initWithSpatialReference:[AGSSpatialReference spatialReferenceWithWKID:4326]];
[polyline addPathToPolyline];
[polyline addPointToPath:losangelesmappoint];
[polyline addPointToPath:aucklandmappoint];
AGSGraphic *poly = [[AGSGraphic alloc] initWithGeometry:polyline symbol:[AGSSimpleLineSymbol simpleLineSymbolWithColor:[UIColor blackColor]] attributes:nil infoTemplateDelegate:nil];
[self.graphicsLayer addGraphic:poly];
[poly release];
I get: When I use normalizeCentralMeridianOfGeometry on the polyline:
AGSPoint *aucklandmappoint =[[AGSPoint alloc] initWithX:aucklandMecPoint.x y:aucklandMecPoint.y spatialReference:[AGSSpatialReference spatialReferenceWithWKID:4326]];
AGSPoint *losangelesmappoint =[[AGSPoint alloc] initWithX:losangelesMecPoint.x y:losangelesMecPoint.y spatialReference:[AGSSpatialReference spatialReferenceWithWKID:4326] ];
[self.graphicsLayer removeAllGraphics];
AGSMutablePolyline *polyline = [[AGSMutablePolyline alloc] initWithSpatialReference:[AGSSpatialReference spatialReferenceWithWKID:4326]];
polyline = (AGSMutablePolyline *)[[AGSGeometryEngine defaultGeometryEngine]normalizeCentralMeridianOfGeometry:polyline];
[polyline addPathToPolyline];
[polyline addPointToPath:losangelesmappoint];
[polyline addPointToPath:aucklandmappoint];
AGSGraphic *poly = [[AGSGraphic alloc] initWithGeometry:polyline symbol:[AGSSimpleLineSymbol simpleLineSymbolWithColor:[UIColor blackColor]] attributes:nil infoTemplateDelegate:nil];
poly.geometry = [[AGSGeometryEngine defaultGeometryEngine]normalizeCentralMeridianOfGeometry:poly.geometry];
[self.graphicsLayer addGraphic:poly];
[poly release];
I get: Note: wrap around is enabled self._mapView.wrapAround = YES;