Class Map


@Marshalled(typeName="map") public class Map extends HtmlElementContainer<Map>
DTO for an HTML <map> element.

The map element defines an image map, which is an image with clickable areas. It contains area elements that define the clickable regions within the image. The map element is referenced by img elements using the usemap attribute to create interactive images.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple image map with rectangular areas Map map1 = map("navigation", area("rect", "0,0,100,50", "https://example.com/home"), area("rect", "100,0,200,50", "https://example.com/about"), area("rect", "200,0,300,50", "https://example.com/contact") ); // Image map with different area shapes Map map2 = map("shapes", area("circle", "150,75,50", "https://example.com/circle"), area("poly", "0,0,100,0,50,100", "https://example.com/triangle"), area("default", null, "https://example.com/default") ); // Image map with accessibility Map map3 = map("accessible", area("rect", "0,0,100,100", "https://example.com/region1") .alt("Click here for region 1"), area("rect", "100,0,200,100", "https://example.com/region2") .alt("Click here for region 2") );

See Also:
  • Constructor Details

    • Map

      public Map()
      Creates an empty Map element.
    • Map

      public Map(Object... children)
      Creates a Map element with the specified child nodes.
      Parameters:
      children - The child nodes. Must not be null.
  • Method Details

    • name

      public Map name(String value)
      name attribute.

      Specifies the name of the image map. This name is used by img elements with the usemap attribute to reference this map for defining clickable areas.

      The name should be unique within the document and should not contain spaces or special characters.

      Parameters:
      value - The name of the image map for referencing from img elements. Can be null to unset the attribute.
      Returns:
      This object.