I am new to Argis , and trying to Work on the World map , So when i am Displaying the World Map as the main View is Square , its not Taking the Full Height and and map is displaying only at certain area and leaves the grey Area within the View .
Can you please Suggest me how to fix that .
Let me know if need more Details
Solved! Go to Solution.
Hello Akshat,
I think the reason is because you didn't set the map extent when you load the mapview. The map is not taking the full height due to view is out of the level of detail (LOD).
The easy way to fix is to set a map extent, please take a look about this documentation about Navigating the map—ArcGIS Runtime SDK for iOS
Here I also shared with you a snippet about how to set a map extent under the (void)viewDidLoad function, also be careful the xmin, ymin, xmax and ymax should match with your tile map spatialReference:
// Add a basemap tiled layer
NSURL *url = [NSURL URLWithString:@"http://services.arcgisonline.com/arcgis/rest/services/ESRI_StreetMap_World_2D/MapServer"];
AGSTiledMapServiceLayer *tiledLayer = [AGSTiledMapServiceLayer tiledMapServiceLayerWithURL:url];
[self.mapView addMapLayer:tiledLayer withName:@"Basemap Tiled Layer"];
AGSEnvelope *envelope = [AGSEnvelope envelopeWithXmin:-124.83145667 ymin:30.49849464 xmax:-113.91375495 ymax:44.69150688 spatialReference:_mapView.spatialReference];
[self.mapView zoomToEnvelope:envelope animated:NO];
Hope this can help.
Best Regards,
Hello Akshat,
I think the reason is because you didn't set the map extent when you load the mapview. The map is not taking the full height due to view is out of the level of detail (LOD).
The easy way to fix is to set a map extent, please take a look about this documentation about Navigating the map—ArcGIS Runtime SDK for iOS
Here I also shared with you a snippet about how to set a map extent under the (void)viewDidLoad function, also be careful the xmin, ymin, xmax and ymax should match with your tile map spatialReference:
// Add a basemap tiled layer
NSURL *url = [NSURL URLWithString:@"http://services.arcgisonline.com/arcgis/rest/services/ESRI_StreetMap_World_2D/MapServer"];
AGSTiledMapServiceLayer *tiledLayer = [AGSTiledMapServiceLayer tiledMapServiceLayerWithURL:url];
[self.mapView addMapLayer:tiledLayer withName:@"Basemap Tiled Layer"];
AGSEnvelope *envelope = [AGSEnvelope envelopeWithXmin:-124.83145667 ymin:30.49849464 xmax:-113.91375495 ymax:44.69150688 spatialReference:_mapView.spatialReference];
[self.mapView zoomToEnvelope:envelope animated:NO];
Hope this can help.
Best Regards,
Hello Yue Wu ,
For this Particular view , we are trying to use , the entire World Map for Layers .so i am not using AGSEnvelope for X and Y min , how to put the X and Y from the entire Globe .
No matter what, the map need a initial extent view on the mapView. Even the world map you also have a center point to locate, right?
You can try this centerAtPoint to insatiate the mapview about the world.
AGSPoint *newPoint = [AGSPoint pointWithX:-90 y:37 spatialReference:self.mapView.spatialReference];
[self.mapView centerAtPoint:newPoint animated:NO];
//enable wrap around
[self.mapView enableWrapAround];
Thanks Wu for Help and its working Very Fine now , but i have Same other Issue w.r.t to Memory Allocation and Decollation in iOS , I will put that as a Separate Thread