com.supermap.mapping

Class Legend

  • java.lang.Object
    • com.supermap.mapping.Legend


  • public class Legend
    extends java.lang.Object

    The legend control class, which is used to represent display symbols of all spatial objects in the current bounds.

    Support for setting legend control properties: line height, text size, text color 3 attributes.

    Note: The legend item returns a maximum of 100; a solid-filled legend requires the user to specify a string of solid colors, which is not displayed in the control if it is not specified.

    • Constructor Detail

      • Legend

        public Legend(Map map)
        The default constructor
        Parameters:
        map - The current map.
    • Method Detail

      • connectLegendView

        public void connectLegendView(LegendView view)
        Associate legend with legend control.
        Parameters:
        view - current map.
      • addColorLegendItem

        public void addColorLegendItem(int type,
                                       ColorLegendItem item)
        Add a color value for the specified type.
        Parameters:
        type - color value legend type (0: point, 1: line, 2: face).
        item - color value legend subkey.
      • removeColorLegendItem

        public void removeColorLegendItem(int type,
                                          ColorLegendItem item)
        Delete the color values of the specified type.
        Parameters:
        type - color value legend type (0: point, 1: line, 2: face).
        item - color value legend subkey.
      • addUserDefinedLegendItem

        public void addUserDefinedLegendItem(LegendItem item)
        Add a user-defined legend subkey.

        The user needs to customize the caption and bitmap for the legend subkey.

        Parameters:
        item - User-defined legend subkey.
      • removeUserDefinedLegendItem

        public void removeUserDefinedLegendItem(LegendItem item)
        Delete the user-defined legend subkey.
        Parameters:
        item - User-defined legend subkey.
      • dispose

        public void dispose()
        Disposes the resources occupied by the object. After calling this method, this object will not be usable.