MapTerritoryTranscript.Chart

Syntax

Chart: PP.MapChart;

Description

The Chart property determines a map for which territory info was created.

Comments

Use JSON or the setChart method to set the property value and the getChart method to get the property value.

Example

To execute the example the HTML page must contain the MapChart component named map (see Example of Creating the MapChart Component). Create a map territory info, show its last page and highlight the item corresponding to the map layer area with the RU-KYA identifier:

// Returns a layer with map areas
function getWorkLayer() {
    return map.getLayer("Regions");
}
// Returns a number of map layer areas
function getShapesCount() {
    var count = 0;
    for (var i in getWorkLayer().getShapes()) {
        count++;
    }
    return count;
}
// Returns map layer area with selected identifier
function getShape(shapeId) {
    return getWorkLayer().getParentLayer().getShape(shapeId);
}
// Creates the map territory info
function createMapTerritoryTranscript() {
    var mapTerritoryTranscript = new PP.MapTerritoryTranscript({
        CellSpacing: 3, // Indent of items
        Chart: map, // Map for which territory info is created
        ParentLayer: getWorkLayer(), // Layer from which map areas are taken
        MaxItemCount: getShapesCount() / 2, // Maximum number of items
        ItemsOrder: PP.Ui.LegendItemsOrder.TopToBottomByPages, //Order of items
        PageMode: PP.Ui.LegendPageMode.MultiplePages // Use multi-page mode
    });
    return mapTerritoryTranscript;
}
// Renders map territory info
function drawMapTerritoryTranscript(mapTerritoryTranscript) {
    var freeArea = new PP.Rect({
        Left: 150,
        Top: 280,
        Width: 450,
        Height: 150
    });
    // Renders info
    mapTerritoryTranscript.draw(freeArea, map.getDomNode());
    // Zoom in map scale
    map.setScale(0.75);
}
// Create map territory info
var mapTerritoryTranscript = createMapTerritoryTranscript();
// Render territory info
drawMapTerritoryTranscript(mapTerritoryTranscript);
// Show the last page of the info
mapTerritoryTranscript.setCurrentPage(mapTerritoryTranscript.getPagesCount() - 1);
// Highlight map layer area with the RU-KYA identifier in the territory info
mapTerritoryTranscript.highlight(getShape("RU-KYA"), true);

After executing the example the map territory info is created, its last page is shown, the item corresponding to the map layer area with the RU-KYA identifier is highlighted:

See also:

MapTerritoryTranscript