Class ImageMap

java.lang.Object
com.day.cq.wcm.foundation.ImageMap

public class ImageMap extends Object
This class is used for parsing image map definitions as generated by the CqImageMap component and make them available through an API to CQ components.

The class is designed for single-threaded use.

  • Method Details

    • fromString

      public static ImageMap fromString(String mapDefinition) throws IllegalArgumentException
      Creates a new ImageMap object from the given string representation.
      Parameters:
      mapDefinition - string representation (as created by the CqImageMap component)
      Returns:
      a suitable representation of the component
      Throws:
      IllegalArgumentException - if the given string representation is invalid
    • draw

      public String draw(String id)
      Returns the HTML code required for the image map.

      Parameters originalSize and scaled can be used to create a scaled map that is suitable for a scaled image.

      Parameters:
      id - id of the image map
      Returns:
      HTML code representing the image map