@kayahr/etchmap
    Preparing search index...

    Class MapElement

    Custom element hosting an interactive map component.

    Importing the package root registers this class as <kayahr-map>. Declarative attributes are parsed atomically and applied to the fixed component returned by getComponent. The open Shadow DOM contains the map Canvas followed by a layer container with the default slot.

    Map attributes:

    • attribution-prefix: Trusted HTML displayed before the source attribution. Set it to false to omit the prefix.
    • center-x and center-y: Source X and Y coordinates. They must be used together and default to the projected tile-world center.
    • zoom: Initial continuous view zoom. Defaults to one level above the effective minimum.
    • min-zoom and max-zoom: Continuous view limits. They default to the native tile-source limits but may extend beyond them.
    • cover-viewport: Whether to raise the effective minimum zoom until tile coverage fills the viewport. Defaults to true.
    • cache-size: Positive integer ready-tile cache capacity. Defaults to 512.
    • source: JSON object describing a custom TileSource. Omit the attribute to use OpenStreetMap. Its projection is web-mercator, linear or an object containing type: "linear" and optional edges.

    Any slotted child becomes an absolutely positioned HTML overlay. The built-in attribution exposes the CSS shadow part attribution.

    <kayahr-map center-x="6.9603" center-y="50.9375" zoom="13"></kayahr-map>
    

    Hierarchy

    • HTMLElement
      • MapElement
    Index
    • Creates a new map element with its own fixed map component.

      Returns MapElement

      Error When nested hybrid component construction violates the one-to-one element/component relationship or a 2D Canvas context cannot be created.

    • Returns the map component hosted by this element.

      Returns MapComponent

      Fixed map component belonging exclusively to this element.