Init commit

Generate a world/countries map, add simple pins, svg with circles
This commit is contained in:
Basile Bruneau
2020-05-04 22:02:43 +02:00
commit 5a12e6e231
8 changed files with 406 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
# dotted-map-generator
## Specs
```js
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,
})
```