Layer styling considerations

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

Managing the style parent

To provide style inheritance (accessible in the Layer Tree Panel), the parent layer style must be a composite style, and you need to manage the style parent on its own:
IlvMapStyle childStyle=layer.getStyle();
childStyle.setParent(parent.getStyle());

Using dynamic styles

When the application uses dynamic styles, you need to access the style controller property of the manager:
IlvMapStyleController themeController = 
IlvMapStyleControllerProperty.GetMapStyleController(manager);
With the controller, you can decide on specific style settings for scale intervals. For example, to change the layer visibility:
themeController.addTheme(1/100000.0,source.getInsertionLayer(),"Visible");
themeController.getStyle(source.getInsertionLayer(),1/
100000.0).setVisibleInView(true);
themeController.getStyle(source.getInsertionLayer(),1/
100000.0).setVisibleInOverview(false);
If you use multiple dynamic styles, you have to take care of style inheritance in a slightly more complex way because more than one style is used:
IlvMapDynamicStyle []t=themeController.getThemes(layer);
for (int i = 0; i < t.length; i++) {
  t[i].getStyle().setParent(parent.getStyle());
}
Once this is done, you can apply the style you want to use for the current scale of the view:
themeController.updateTheme(view,layer);
Alternatively, you can set up the theme for all layers in one single call:
themeController.updateCurrentTheme();

Layer ordering

With multithreading data sources, it is often impossible to predict the order in which the underlying manager layers are created. The manager layer order determines which graphic objects are on top of the map or in the background. When data sources have been created and inserted, you can arrange the manager layer order to be coherent with the map layer tree organization, with a call to:
ltm.arrangeLayers();