Setting Constant Value for Map Scale

Operating system requirements: iOS 5.0 or later.

Mobile device: iPad.

Description

This example describes setting of constant value for map scale and getting of value for specified map layer area.

Required Files

Executing the example requires to place the following code in the body of the executeExample method of the ViewController class (see the Creating a Map with Time Line section):

// Get object settings of map dependency on data
DataDependency *dataDependency = (DataDependency *)[[[[[m_view layers] objectAtIndex:0] visuals] objectAtIndex:0] background];
// Specify that map does not depend on data source
[dataDependency setIsDependent:NO];
// Set map value
UIColor *mapColor = [UIColor colorWithIntRed:177 green:202 blue:64 alpha:255];
[dataDependency setValue:[SolidColorBrush solidColorBrushWithColor:mapColor]]; // Get value for map layer area with the RU identifier NSNumber *value =[datasource valueWithId:@"RU"]; NSLog(@"Value for map layer area "RU"": %@", value);

After executing the example all map layer areas are filled with the specified color that is set as a constant for map scale:

The development environment console displays the value for map layer area with the RU identifier:

Value for map layer area with the RU identifier: 11.38622

See also:

Examples of Component Use