Skip to main content

CustomControl

Controls & Overlays
View Docs

Position arbitrary custom content on the map with collision avoidance

controlcustomwidgetoverlaypositioncollision

Demo

Custom Control Demo. Interactive map centered at 37.80 degrees N, 122.40 degrees W at zoom level 12. Use keyboard to navigate.

Control Position

Visible Controls

About CustomControl

CustomControl positions arbitrary content on the map with collision avoidance and z-index management via the positioning coordinator.

CustomControl Features:

  • Position content at any map corner or center position
  • Automatic collision avoidance with other controls
  • Fallback positions when primary position is occupied
  • Priority levels for collision resolution (low, normal, high, critical)
  • Z-index layers for proper stacking (base, interactive, overlay, modal)
  • Supports any Svelte content as children
  • Custom styling via class and style props
  • Auto-generated or custom IDs for coordination

Usage

import { CustomControl } from '@classic-homes/maps-svelte';
// or for React:
import { CustomControl } from '@classic-homes/maps-react';

Related Components