Creates a new map component with its own map element.
Initial map options.
Error When the browser cannot provide a 2D Canvas context or hybrid construction violates the one-to-one component/element relationship.
RangeError When cache capacity, load concurrency, source geometry, coverage, zoom limits or zoom are invalid.
TypeError When the tile source is malformed.
Trusted HTML displayed before the tile-source attribution.
Current attribution prefix, or false when omitted.
Changes the HTML displayed before the tile-source attribution.
The string is inserted as trusted HTML without sanitization. It must never contain untrusted input.
New trusted HTML, false to omit the prefix, or null to restore the default linked Powered by EtchMap prefix.
Maximum number of ready tile images retained in memory.
Positive tile-cache capacity.
Changes the tile-cache limit and starts with a fresh cache.
Positive integer number of ready tile images to retain.
RangeError When cacheSize is not a positive integer.
Current center in source coordinates.
Center interpreted by the current tile source projection.
Changes the center in source coordinates immediately and stops active camera motion.
New center interpreted by the current tile source projection, or null to use the center of its tile coverage.
Whether the effective minimum zoom is raised until the tile coverage fills the viewport.
true while viewport coverage constrains the minimum zoom.
Enables or disables the viewport-cover zoom constraint.
Whether tile coverage must fill the viewport.
Current device pixel ratio used for drawing.
Number of Canvas device pixels per exposed CSS pixel.
Logical map height in CSS pixels.
Height used by the drawing context and projection helpers.
Maximum continuous view zoom.
Explicit map maximum, or the current source maximum when no override is configured.
Changes the maximum continuous view zoom.
New map maximum, or null to follow the current tile source maximum.
RangeError When the resolved range is not finite or its minimum is greater than its maximum.
Minimum continuous view zoom before applying the optional viewport-cover constraint.
Explicit map minimum, or the current source minimum when no override is configured.
Changes the minimum continuous view zoom.
New map minimum, or null to follow the current tile source minimum.
RangeError When the resolved range is not finite or its minimum is greater than its maximum.
Native map height in device pixels.
Canvas backing-store height.
Native map width in device pixels.
Canvas backing-store width.
Callback invoked synchronously after drawing the map.
Current callback, or null when no custom drawing is configured.
Sets the callback invoked after drawing the map.
Changing the callback invalidates the current map contents.
Callback to invoke after each produced map frame, or null to remove it.
Current normalized tile source.
Immutable tile-source view with every optional setting resolved.
Changes the tile source immediately, resets the tile cache and stops active camera motion.
New tile source, or undefined to restore the default OpenStreetMap source.
RangeError When tile geometry, coverage or zoom limits are invalid or exceed safe integer coordinates.
TypeError When the URL or projection is invalid.
Logical map width in CSS pixels.
Width used by the drawing context and projection helpers.
Current continuous zoom level.
Zoom clamped to the current map and viewport limits.
Changes the continuous zoom immediately around the viewport center and stops active camera motion.
New continuous zoom level, or null to restore the automatic initial zoom.
RangeError When zoom is not finite.
Centers and zooms the map so all specified source-coordinate points fit into the viewport.
The fit uses the shortest horizontal span for a wrapping source. Existing map, source and viewport zoom constraints remain in effect, so sufficiently restrictive constraints can prevent the complete requested area or margin from becoming visible.
Non-empty collection of points interpreted by the current tile-source projection.
Optional animation, viewport margin and operation-specific maximum zoom.
RangeError When no points are supplied, the viewport has no area, the margin is negative, non-finite or leaves no usable area,
or maxZoom is not finite.
Returns the custom element owned by this component.
Fixed map element belonging exclusively to this component.
Invalidates the current map contents and schedules a redraw for the next animation frame.
Repeated invalidations before the scheduled frame are combined into a single redraw.
Projects one source-coordinate point and provides a clipped viewport-edge position when it is outside.
Point in source coordinates.
Optionaloptions: PointProjectionOptions & { wrapCopies?: false }
Viewport margin with horizontal world-copy expansion disabled.
Nearest projected point, enriched with a clipped position when it is outside the margin-adjusted viewport bounds.
RangeError When the margin is not finite or a negative margin collapses the viewport.
Projects every visible horizontal world copy of a source-coordinate point without clipping.
Point in source coordinates.
Viewport options with horizontal world-copy expansion enabled.
Visible projected copies in viewport-relative CSS pixels.
RangeError When the margin is not finite or a negative margin collapses the viewport.
Projects either one nearest or every visible horizontal world copy of a source-coordinate point.
Point in source coordinates.
Point projection options.
Nearest potentially clipped point or all visible copies, according to options.wrapCopies.
RangeError When the margin is not finite or a negative margin collapses the viewport.
Projects every visible horizontal world copy of a polygon and clips them to the viewport.
Polygon vertices in source coordinates. An explicit duplicate closing point is optional.
Path interpolation and clipping-margin options. Natural edge interpolation is the default.
Visible clipped polygons in viewport-relative CSS pixels, one array per horizontal world copy.
RangeError When the margin is not finite or a negative margin collapses the viewport.
Projects every visible horizontal world copy of a polyline and clips it to the viewport.
Ordered polyline vertices in source coordinates.
Path interpolation and clipping-margin options. Natural edge interpolation is the default.
Separate visible clipped polyline runs in viewport-relative CSS pixels across all visible horizontal world copies.
RangeError When the margin is not finite or a negative margin collapses the viewport.
Sets the source-coordinate center and zoom atomically and stops active camera motion.
New center interpreted by the current tile source projection, or null to use the center of its tile coverage.
New continuous zoom level, clamped to the current source and viewport limits.
RangeError When zoom is not finite.
Changes both continuous view-zoom limits atomically.
Map limits are independent of native tile LOD and may extend beyond the current source limits. Passing null for a limit makes it follow the
corresponding current tile-source limit.
New map minimum, or null to follow the source minimum.
New map maximum, or null to follow the source maximum.
RangeError When the resolved range is not finite or its minimum is greater than its maximum.
Standalone interactive raster-tile map component which owns its corresponding custom element.
The component provides the programmatic map API. It owns a continuous camera, DPR-aware Canvas, interaction controller, tile cache and renderer, and exactly one MapElement. Add the element returned by getElement to the document to display the map.