Map scales and layer styles

As a result of the use of the IlvMapStyleControllerProperty property of the manager (and its underlying IlvMapStyleController), layer styles are dependant on the current scale of the map. Every style attribute of a map layer can be different at different scales.
One of the most widely used attribute changes is the VISIBLE_IN_VIEW attribute, which is used to show and hide different map layers at particular scales. Using the same mechanism, your users can also change colors, line thickness, decorations and so on. Whenever the scale changes, the scale controller can change the current map layer styles, if required. This change of style usually triggers a view repaint, because the attributes of the objects have changed.
Some objects also listen to these style changes in order to re-render themselves. For example, if the color model of a raster style changes, all the images that depend on the style need to be re-created.
You can add dynamic styles with API calls such as:
IlvMapStyleController themeControl=
  IlvMapStyleControllerProperty.GetMapStyleController(view.getManager());
themeControl.addTheme(0.001,mapLayer,"new style");
themeControl.getStyle(mapLayer,0.001).setVisibleInView(true);
When you add dynamic styles, be careful to ensure that you still manage style inheritance. When adding a new map layer into a parent layer, you can do this as follows:
IlvMapDynamicStyle []t=themeControl.getThemes(mapLayer);
for (int i = 0; i < t.length; i++) {
   t[i].getStyle().setParent(parentLayer.getStyle());
}
The source code for the Map Builder demonstration, which contains all of the code described in this section, can be found at <installdir> /jviews-maps810/samples/mapbuilder/index.html.