Setting Screen Center in Topobase Coordinates

Operating system requirements: iOS 5.0 or later.

Mobile device: iPad.

Description

This example shows setting of new screen center coordinates. The following operations are also executed after its start:

Source Code

Executing the example requires to place the following code instead of the contents of the mapChart:touchDownInShape: method of the ViewController class (see the Creating a Map with a Timeline section):

/* Zoom and scroll
for displaying of specified map layer area with animation playback */
[mapChart zoomToShape:shape animated:YES];
// Hide timeline and keep only text label with the current year
[mapChart setInBlock:YES];
// Hide legend
[[mapChart legend] setVisibility:NO];
// Get coordinates of screen center point in topobase coordinates
CGPoint centerPoint = [mapChart pivot];
// Reduce these coordinates tow times
centerPoint.x /= 2;
centerPoint.y /= 2;
[mapChart setPivot:centerPoint];

Then manually press the map layer area with the RU identifier. As a result, the map is zoomed and scrolled not to the area as implemented in the Map Zoom and Scroll example, but to the screen center point with the coordinates reduced two times. relative to the initial ones. The timeline is hidden, only the text label with the current year is kept:

See also:

Examples of Component Use