@htmlbricks/hb-map
v0.67.0
Published
Interactive map: `center`, `zoom`, `source` (OSM or CARTO vector styles), `options` (e.g. `centerFromGeometries`, marker text layout), and `data` with markers (lng/lat, icon, popup HTML, text). Set `screenshot` to capture; emits map clicks, marker clicks,
Readme
hb-map
Description
Interactive map: center, zoom, source (OSM or CARTO vector styles), options (e.g. centerFromGeometries, marker text layout), and data with markers (lng/lat, icon, popup HTML, text). Set screenshot to capture; emits map clicks, marker clicks, and screenshot payloads.
Types
export type Component = {
id?: string;
style?: string;
zoom: number;
center: number[];
data: {
marker?: {
lngLat: number[];
icon?: {
uri: string;
scale?: number;
anchor?: number[];
opacity?: number;
color?: string;
};
id?: string;
popupHtml?: string;
text?: string;
text_position?: "top" | "right" | "bottom" | "left";
text_offset?: number;
};
point?: {
lngLat: number[];
icon?: {
uri: string;
scale?: number;
anchor?: number[];
opacity?: number;
color?: string;
};
id?: string;
popupHtml?: string;
};
line?: {
lngLat: number[];
icon?: {
uri: string;
scale?: number;
anchor?: number[];
opacity?: number;
color?: string;
};
id?: string;
popupHtml?: string;
}[];
}[];
source: { type: string; url?: string; style?: "positron" | "dark_matter" | "voyager" };
options: {
centerFromGeometries?: boolean;
text_position?: "top" | "right" | "bottom" | "left";
text_offset?: number;
text_scale?: number;
};
screenshot?: string;
};
export type Events = {
pointClickCoordinates: {
coordinates: { latitude: number; longitude: number };
zoom: number;
center: number[];
};
markerClick: {
coordinates: { latitude: number; longitude: number };
id: string;
};
screenshotTaken: {
base64: string;
};
};