Files
dotted-map-no-alaska/README.md
T
Basile Bruneau 5a12e6e231 Init commit
Generate a world/countries map, add simple pins, svg with circles
2020-05-04 22:02:43 +02:00

636 B

dotted-map-generator

Specs

const map = new DottedMap({
  height,
  width, // (one of both if enough)
  countries: ['FRA', 'DEU'] // if not present, whole world is used
  region: { lat: {min, max}, lng: {min, max} }, // if not present, it fits the countries or the world
})

// → it will cache the points array
DottedMap.clearCache()

map.addPin({
  lat,
  lng,
  svgOptions: { color, radius },
  data, // whatever you want
})

map.getPoints(): [{ x, y, data }]

map.getSVG({
  shape: 'circle' | 'hexagon' | 'square', // custom path is possible
  color,
  backgroundColor, // transparent is possible
  radius: 0.5,
})