Calm motion: animations on this site only fade, with no movement
Map with pins
A map from web map tiles with pins that you can select, zoom, and drag
Shows places on a map, such as stores, events, or deliveries. It draws standard web map tiles itself, so the library adds no map package.
Basic
Select a pin.
v-model:centeris the middle of the map as[latitude, longitude].v-model:zoomis a whole number from 1 to 19 (default 13).pinsis the list of places. Each pin has anid, alat, anlng, and alabel.- A pin is a button with its label as the name. A click selects it in
v-model:selectedand shows the label on the map. - Drag the map to move it. The + and − buttons zoom. When the map has the focus, the arrow keys move it, and the + and − keys zoom.
tilesis a tile URL with{z},{x}, and{y}. The default is the OpenStreetMap tile server. Its rules ask for light use and the credit. For a busy site, use your own tile server or a paid one.attributionandattribution-urlset the credit in the corner. Keep the credit that your tile server asks for.heightsets the height in pixels (default 360). The map takes the width of its box.
The project and unproject functions turn latitude and longitude into Web Mercator pixels and back. They are exported for your own views.
Usage
ts
import { BlessMapPins } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
pins | BlessMapPin[] | [] | |
height | number | 360 | |
tiles | string | "https://tile.openstreetmap.org/{z}/{x}/{y}.png" | a tile URL with {z}, {x}, and {y}; the default is the OpenStreetMap tile server |
attribution | string | "© OpenStreetMap contributors" | the credit that the tile server asks for, as text |
attributionUrl | string | "https://www.openstreetmap.org/copyright" | |
labels | Partial<{ map: string; zoomIn: string; zoomOut: string; keys: string; }> | — | |
center* | [number, number] | — | |
zoom | number | 13 | |
selected | string | — |
Events
| Name | Payload | Description |
|---|---|---|
update:selected | [value: string | undefined] | |
update:center | [value: [number, number]] | |
update:zoom | [value: number] |








