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];
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];
self._mapView.wrapAround = YES;
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]; polyline = (AGSMutablePolyline *)[[AGSGeometryEngine defaultGeometryEngine]normalizeCentralMeridianOfGeometry:polyline]; AGSGraphic *poly = [[AGSGraphic alloc] initWithGeometry:polyline symbol:[AGSSimpleLineSymbol simpleLineSymbolWithColor:[UIColor blackColor]] attributes:nil infoTemplateDelegate:nil]; [self.graphicsLayer addGraphic:poly]; [poly release];
NSURL *mapUrl = [NSURL URLWithString:@"http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"]; AGSTiledMapServiceLayer *tiledLyr = [AGSTiledMapServiceLayer tiledMapServiceLayerWithURL:mapUrl];
AGSMutablePolyline *polyline = [[AGSMutablePolyline alloc] initWithSpatialReference:[AGSSpatialReference spatialReferenceWithWKID:102100]];
One last thing is when trying to show the mapview's spatial reference, I alway get a null back.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.