0
繪製的AGSPoint我綜合arcGis
SDK來我iOS
項目 而是試圖繪製agsPoint
到某一點時,它總是密謀(0,0)。我想提前上AGSMapView的iOS
AGSSpatialReference *spatialRefference = [AGSSpatialReference spatialReferenceWithWKID: 102100];
// 4326 ,102100
AGSPoint *newPoint=[[AGSPoint alloc]init];
//newPoint2= [AGSPoint pointWithX:75.871952 y:22.685667 spatialReference:spatialRefference];
//newPoint= [AGSPoint pointWithLocation:locInstance.locationManager.location];
[myMap zoomToResolution:2.0 withCenterPoint:newPoint animated:YES];
//1. Create Graphics Layer
AGSGraphicsLayer* myGraphicsLayer = [[AGSGraphicsLayer alloc]initWithSpatialReference:newPoint.spatialReference];
[myMap addMapLayer:myGraphicsLayer withName:@"Graphics Layer"];
//2. Create a marker symbol to be used by our Graphic
AGSSimpleMarkerSymbol *myMarkerSymbol =[AGSSimpleMarkerSymbol simpleMarkerSymbol];
myMarkerSymbol.color = [UIColor blueColor];
myMarkerSymbol.style = AGSSimpleMarkerSymbolStyleDiamond;
myMarkerSymbol.outline.color = [UIColor whiteColor];
myMarkerSymbol.outline.width = 1;
//3. Create an AGSPoint (which inherits from AGSGeometry) that
//defines where the Graphic will be drawn
AGSPoint* locPoint =[[AGSPoint alloc]init];
locPoint=[AGSPoint pointWithLocation:locInstance.bestEffortAtLocation];
AGSGeometryEngine* engine = [AGSGeometryEngine defaultGeometryEngine];
AGSGeometry *pointToDraw= [engine projectGeometry:locPoint toSpatialReference:newPoint.spatialReference];
//4. Create the Graphic, using the symbol and
//geometry created earlier
//[AGSGraphic graphicWithGeometry:locPoint symbol:myMarkerSymbol attributes:attributes];
AGSGraphic* myGraphic = [[AGSGraphic alloc]init];
myGraphic= [AGSGraphic graphicWithGeometry:pointToDraw symbol:myMarkerSymbol attributes:attributes];
[myGraphicsLayer addGraphic:myGraphic];
AGSPoint * gpsPoint = [[AGSPoint頁頭] initWithX: gpsLocation.coordinate.longitude y:gpsLocation.coordinate.latitude spatialReference:[AGSSpatialReference wgs84SpatialReference]]; 現在它的工作! –