ScaleBase.First

Syntax

First: Object

Description

The First property sets the first element for the scale.

Comments

This property is used to automatically calculate scale elements.

Example

To execute the example, the HTML page must contain the Placing of Map on a HTML PageMapChart (see Placing of Map on a HTML Page) component named map, XML file with settings of map and the Russia.svg topobase.

The XML file must contain settings of the fill factor that is the first located in the list of map factors. Fill background - dependency object, for which scale is set up.

Let us create the scaleSet() to edit scale colors:

function scaleSet() {

   scale = map.getFirstVisual().getBackground().getMapScale();

   if (scale.getItemsMode() = "Array") {//If a collection of scale items has been previously defined, the following settings are applied

      scale.setFirst("White");

      scale.setLast("Red");

      scale.setIntervalsCount(4);

      map.draw();

   }

}

map.Loaded.add(scaleSet);

After executing the example map fill changes if a collection of scale items has been previously defined:

See also:

ScaleBase