Creates a new map element with its own fixed map component.
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.
Fixed map component belonging exclusively to this element.
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 tofalseto omit the prefix.center-xandcenter-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-zoomandmax-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 totrue.cache-size: Positive integer ready-tile cache capacity. Defaults to 512.source: JSON object describing a custom TileSource. Omit the attribute to use OpenStreetMap. Itsprojectionisweb-mercator,linearor an object containingtype: "linear"and optionaledges.Any slotted child becomes an absolutely positioned HTML overlay. The built-in attribution exposes the CSS shadow part
attribution.Example