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.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.