World Map

Displays a customizable world map with animated arcs and pulse effects for geographical points.

API

Prop NameTypeDefaultDescription
dotsArray<{ start: { lat: number; lng: number; label?: string }, end: { lat: number; lng: number; label?: string } }> []Array of dot objects, each containing a start and end coordinate (latitude, longitude).
classstring""Additional CSS classes for custom styling.
lineColorstring"#0EA5E9"Color of the arcs and dot borders.
mapColorstringMain color of the dotted map. (Required)
mapBgColorstringBackground color of the map. (Required)

Install using CLI

npm
pnpm
bun
yarn
npx shadcn-vue@latest add "https://inspira-ui.com/r/world-map.json"

Install Manually

Install the dependencies

npm
pnpm
bun
yarn
npm install dotted-map

Component Code

You can copy and paste the following code to create this component:

WorldMap.vue

Features

  • Animated Arcs: Smooth arcs between two geographical points using an SVG path.
  • Dotted Background: Renders a dotted map using the DottedMap library.
  • Pulsing Markers: Each point animates with expanding circles to highlight the location.
  • Dynamic Projection: Projects latitude/longitude to an 800x400 coordinate plane.
  • Customizable Colors: Control lineColor, mapColor, and mapBgColor.

Credits