How to Set the map to take Fullview (Height)

2348
4
Jump to solution
08-08-2014 10:32 PM
akshatanil
New Contributor II

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

Tags (1)
1 Solution

Accepted Solutions
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

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,

View solution in original post

0 Kudos
4 Replies
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

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,

0 Kudos
akshatanil
New Contributor II

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 .

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

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];

0 Kudos
akshatanil
New Contributor II

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

0 Kudos