【发布时间】:2014-01-07 10:34:59
【问题描述】:
全部
我是arcgis for iOS的新手,现在遇到一个奇怪的问题,我已经查看了其他线程但没有找到任何解决方案。
我想在我的图形图层上显示经度为 116.929167 纬度为 34.727222 的建筑物。我的基础地图图层位于 WGS84 空间参考。
但是,当我第一次尝试以下代码时,它会导致点错位。 注意:这个地方在中国江苏省的某个地方,但它被放置在中国湖南省。
//create an instance of a tiled map service layer
AGSTiledMapServiceLayer *tiledLayer = [[AGSTiledMapServiceLayer alloc] initWithURL:[NSURL URLWithString:kTiledMapServiceURL]];
//Add it to the map view
[self.mapView addMapLayer:tiledLayer withName:@"Tiled Layer"];
//release to avoid memory leaks
//set the callout delegate so we can display callouts
self.mapView.callout.delegate = self;
//add graphics layer for the graphics
self.graphicsLayer = [AGSGraphicsLayer graphicsLayer];
//add the graphics layer to the map
[self.mapView addMapLayer:self.graphicsLayer withName:@"Graphics Layer"];
//zoom to china
AGSEnvelope *chinaEnv = [AGSEnvelope envelopeWithXmin:78.0000000
ymin:0.4400000
xmax:156.0000000
ymax:75.0000000
spatialReference:[AGSSpatialReference wgs84SpatialReference]];
[self.mapView zoomToEnvelope:chinaEnv animated:YES];
self.mapView.callout.customView = nil;
self.mapView.callout.accessoryButtonHidden = YES;
double longitude = 116.929167;
double latitude = 34.727222;
AGSPoint *graphicPoint = [AGSPoint pointWithX:longitude y:latitude spatialReference:[AGSSpatialReference wgs84SpatialReference]];
[self.mapView.callout showCalloutAt:graphicPoint screenOffset:CGPointMake(0, 0) animated:YES];
谁能告诉我为什么它不能显示正确的位置以及如何解决这个问题? 非常感谢您的时间和回答! 最好的问候。
【问题讨论】: