MapChart.refreshView

Syntax

refreshView(args: PP.Ui.PropertyChangedEventArgs);

Parameters

args. Map settings.

Description

The refreshView method refreshes the map in accordance with specified settings.

Example

To execute the example the HTML page must contain the MapChart component named map (see Example of Creating the MapChart Component). Set new border width and border color for the map legend, process the Refreshed event showing values of changed properties to the browser console:

// Get map settings
var state = map.getState();
// Get metadata
for (var i in state.getMetadata()) {
    var data = state.getMetadata()[i];
    switch (data.Name) {
    case "mapmaster.stylespanel.borderthickness":
        // Change width of legend border
        data.Value = 3;
        break;
    case "mapmaster.stylespanel.border":
        // Change color of legend border to red
        data.Value = "#ff0000";
        break;
    }
};
// Process the Refreshed event
map.Refreshed.add(function (sender, args) {
    for (var i in args.getMetadata()) {
        var data = state.getMetadata()[i];
        switch (data.Name) {
        case "mapmaster.stylespanel.borderthickness":
            console.log("Width of legend border: " + data.Value);
            break;
        case "mapmaster.stylespanel.border":
            console.log("Border color: " + data.Value);
            break;
        }
    }
});
// Refresh the map using new settings
map.refreshView(state);
// Hide territory info
map.getMapTerritoryTranscript().hide();

After executing the example new width and color are set for map legend border:

After firing the Refreshed event the browser console displays values of changed map properties:

Border color: #ff0000

Width of legend border: 3

See also:

MapChart