# Routes (Maps example)

> WestCoast Charts 1.1.5, release, public Core release, on npm. HTML: https://westcoast-charts.com/gallery/maps/routes/ · Index for agents: https://westcoast-charts.com/llms.txt

A round-the-world itinerary as one route along great circles (stops, arrows, total distance in the tooltip) and a dashed shipping lane through named waypoints.

- Chart type: `map` (Map)
- Collection: Maps · Maps
- Raw configuration: https://westcoast-charts.com/gallery-src/maps/routes.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/premium/maps/routes.html

## Setup

```js
import WestCoastCharts from 'west-coast-charts'
import types from 'west-coast-charts/types'
import premium from 'west-coast-charts/premium'
import 'west-coast-charts/maps/world' // registers the map shapes

WestCoastCharts.use(types).use(premium)
const WestCoastChartsPremium = premium
WestCoastCharts.setLicenseKey(LICENCE_KEY) // paid production licence; localhost evaluation needs no key
```

## Options

```js
const options = {
  chart: {
    height: 480,
    toolbar: {
      show: false
    },
    type: "map"
  },
  series: [
    {
      name: "Itinerary",
      type: "route",
      labels: true,
      data: [
        {
          name: "Round the world",
          path: [
            {
              name: "Berlin",
              lon: 13.4,
              lat: 52.52
            },
            {
              name: "Dubai",
              lon: 55.27,
              lat: 25.2
            },
            {
              name: "Singapore",
              lon: 103.82,
              lat: 1.35
            },
            {
              name: "Sydney",
              lon: 151.21,
              lat: -33.87
            },
            {
              name: "Los Angeles",
              lon: -118.24,
              lat: 34.05
            },
            {
              name: "New York",
              lon: -74,
              lat: 40.7
            },
            {
              name: "Berlin",
              lon: 13.4,
              lat: 52.52
            }
          ]
        }
      ]
    },
    {
      name: "Shipping",
      type: "route",
      dash: "7 5",
      width: 2,
      data: [
        {
          name: "Shanghai → Rotterdam",
          geodesic: false,
          path: [
            {
              name: "Shanghai",
              lon: 121.5,
              lat: 31.2
            },
            {
              name: "Singapore",
              lon: 103.8,
              lat: 1.3
            },
            {
              name: "Colombo",
              lon: 79.9,
              lat: 6.9
            },
            {
              name: "Gulf of Aden",
              lon: 48,
              lat: 12.5
            },
            {
              name: "Suez",
              lon: 32.5,
              lat: 30
            },
            {
              name: "Gibraltar",
              lon: -5.6,
              lat: 36
            },
            {
              name: "Rotterdam",
              lon: 4.5,
              lat: 51.9
            }
          ]
        }
      ]
    }
  ],
  plotOptions: {
    map: {
      fit: "map",
      legend: {
        show: false
      }
    }
  },
  theme: {
    mode: "light",
    preset: "coastal"
  }
}

const chart = new WestCoastCharts(document.querySelector('#chart'), options)
await chart.render()
```

## Verify

- Text check (Library 1.1.5): load `west-coast-charts/agent/describe` and call `chart.describe({ format: "json" })` for the actual drawn state. The live reader is on this example’s HTML page.
- Command line (Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm, https://westcoast-charts.com/docs/cli/index.md): `wcc chart export maps-routes.json --out maps-routes.svg --with-table` (save the options above as JSON first)
